From nobody Sun Feb 8 11:43:16 2026 Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6FDE13A418 for ; Wed, 14 Aug 2024 22:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723672832; cv=none; b=uA3DgJjgVgQbxanR95H9h6xPWA23hfkFVCsrjjy35LZHsG2zKj+ZUB9l9u+McSIKxdh0icJgIktL4QYuTwy5+ljBMIBKxqVjrqTHoZAIs/sO2cQcH/leXj6sMREoQOV8yFdSstXGAxFIRzkjhjl0qKWshwQJg3M41WWdPc6tV1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723672832; c=relaxed/simple; bh=eYlMSthMiGu/5Moa/ziHx0rMfzWpxOnwtFWkMfZn/k4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pZN66wwUv5CfjeODbuAZiGePK6pNGzhhMFgMePtKwAFeiNhgvz6mhTnukGDeL1jNi4mnRgC1AjflXkdNbn+WK28T01qhlDhb6HXNDpbDhVAmDJTwvGmOO3+vverkE42+Iipa6sH2jxO6sbzNjhd7/j9dBzoCgBHqq57tEqpXR1M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=k9XxL/qK; arc=none smtp.client-ip=95.215.58.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="k9XxL/qK" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723672828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Sz+pgwG6Tx1uUhOGcclu4o7yKd27wktU4rb6DA6XtvQ=; b=k9XxL/qKt4zG1aGG3dBCyAmd5Sr42RvCEY0LaEM5mhGJOs3iQS7NWyg16PZugFZD70n2/F 5+lrHgDm6NgICmu3CH9OMHq38yZUFvuCOSBlGCyH6GGhlHYNo2MY4XW3AS6uwM8oVsiXdU O58UoLfoOb4+zfQgfOUYIDw3Nw1MyXE= From: Shakeel Butt To: Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , "T . J . Mercier" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team , cgroups@vger.kernel.org Subject: [PATCH v2 1/4] memcg: initiate deprecation of v1 tcp accounting Date: Wed, 14 Aug 2024 15:00:18 -0700 Message-ID: <20240814220021.3208384-2-shakeel.butt@linux.dev> In-Reply-To: <20240814220021.3208384-1-shakeel.butt@linux.dev> References: <20240814220021.3208384-1-shakeel.butt@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Memcg v1 provides opt-in TCP memory accounting feature. However it is mostly unused due to its performance impact on the network traffic. In v2, the TCP memory is accounted in the regular memory usage and is transparent to the users but they can observe the TCP memory usage through memcg stats. Let's initiate the deprecation process of memcg v1's tcp accounting functionality and add warnings to gather if there are any users and if there are, collect how they are using it and plan to provide them better alternative in v2. Signed-off-by: Shakeel Butt Reviewed-by: T.J. Mercier --- Changes since v1: - Fix documentation Documentation/admin-guide/cgroup-v1/memory.rst | 8 ++++++++ mm/memcontrol-v1.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/Documentation/admin-guide/cgroup-v1/memory.rst b/Documentation= /admin-guide/cgroup-v1/memory.rst index 9cde26d33843..0114d758beab 100644 --- a/Documentation/admin-guide/cgroup-v1/memory.rst +++ b/Documentation/admin-guide/cgroup-v1/memory.rst @@ -105,10 +105,18 @@ Brief summary of control files. memory.kmem.max_usage_in_bytes show max kernel memory usage recorded =20 memory.kmem.tcp.limit_in_bytes set/show hard limit for tcp buf memory + This knob is deprecated and shouldn't= be + used. memory.kmem.tcp.usage_in_bytes show current tcp buf memory allocation + This knob is deprecated and shouldn't= be + used. memory.kmem.tcp.failcnt show the number of tcp buf memory usa= ge hits limits + This knob is deprecated and shouldn't= be + used. memory.kmem.tcp.max_usage_in_bytes show max tcp buf memory usage recorded + This knob is deprecated and shouldn't= be + used. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D =20 1. History diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c index 9725c731fb21..b8e2ee454eaa 100644 --- a/mm/memcontrol-v1.c +++ b/mm/memcontrol-v1.c @@ -2447,6 +2447,9 @@ static ssize_t mem_cgroup_write(struct kernfs_open_fi= le *of, ret =3D 0; break; case _TCP: + pr_warn_once("kmem.tcp.limit_in_bytes is deprecated and will be removed= . " + "Please report your usecase to linux-mm@kvack.org if you " + "depend on this functionality.\n"); ret =3D memcg_update_tcp_max(memcg, nr_pages); break; } --=20 2.43.5