From patchwork Wed Aug 14 20:28:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13763928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4E8CC52D7F for ; Wed, 14 Aug 2024 20:28:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60CDC6B0089; Wed, 14 Aug 2024 16:28:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5957B6B008A; Wed, 14 Aug 2024 16:28:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 437176B008C; Wed, 14 Aug 2024 16:28:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 217066B0089 for ; Wed, 14 Aug 2024 16:28:48 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D6F228119B for ; Wed, 14 Aug 2024 20:28:47 +0000 (UTC) X-FDA: 82451989494.22.F17C582 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) by imf07.hostedemail.com (Postfix) with ESMTP id 11A194000F for ; Wed, 14 Aug 2024 20:28:45 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=vvo2dAml; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf07.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.183 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723667267; a=rsa-sha256; cv=none; b=Wq17YDPq7zmnCIZ2/niX5hXjtqaG9CAIOo0PZRGWIJKz4h0WSRA4KWfyHze7ns3mJM/i6N 3QowaUlZgL5YNYbKEgxOrFKM0/00y+qddJpNQFoV6mjvDDgTuV4oFXjvZQqVecKCMFkAbr DjwWcQzngvuUhEc6ZUxFSskA2sXfIps= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=vvo2dAml; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf07.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.183 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723667267; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YuTcvSW9Di06EfL0eDnFgAZS8RJd4NfEvtxJHSVe1sg=; b=EH05iGoVO+zM7lozoTk9iGXeqZ+d1XyGVf/fuX/0pLKS1olKa4KqEPyLITl/4pprM/V4VJ e3WuQtuZ8gsXkMJsQysuYuM8BqHIMZnFAsuimafReS+2QObVavHjTGJLHbQ2qFZ83wNP99 AgCYbTuOcTbd266kW2gcmJ9B+cVmhFA= 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=1723667324; 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=YuTcvSW9Di06EfL0eDnFgAZS8RJd4NfEvtxJHSVe1sg=; b=vvo2dAmlpYSQYHhGtKfIuWJfO+kJhk5WnvGdclU5CU9cDOmn/jsaasYKEFAhDLlCloevd3 +dExAtypgTNUQ+nNTXmJ/j/EFS1cHLkgaYnmoDiouffshNOgBHAapG+utAWl+Lu5osG6c9 CWLZZGuJQ1RMm71iqpLzwNABbwK/bLU= From: Shakeel Butt To: Andrew Morton Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team , cgroups@vger.kernel.org Subject: [PATCH 1/4] memcg: initiate deprecation of v1 tcp accounting Date: Wed, 14 Aug 2024 13:28:22 -0700 Message-ID: <20240814202825.2694077-2-shakeel.butt@linux.dev> In-Reply-To: <20240814202825.2694077-1-shakeel.butt@linux.dev> References: <20240814202825.2694077-1-shakeel.butt@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 11A194000F X-Stat-Signature: 5s47qm6y1sxers6ygrp4k3twzt91exzh X-Rspam-User: X-HE-Tag: 1723667325-789824 X-HE-Meta: U2FsdGVkX1+ZsXWpnvnEAPBoAxVF+SkVZ8/F18m928HzERH7cO0lHHvWh6L92gnc+byDT8pTSCAat3ilXwGj4+MykBMM4xpEagYyMZnxoyXzRYW5BK8n2Qf49lyDwpIBE7YZNIaIErAxlbW2RiJVog0PvBE+3F+sGQvu+Tjamc2HjsAJMzh08CkfHWmbrMM1aheNDPU3UnDZLyfn5d+Cue4F1zTIvrqPFF4ZTN77QlkUdj+4+qgUtrOvEkU2gJDhBHAnuqPztkRYPKfaloeJ5n0f91PlMa5w8EpC5oq1taDXmzD0b0NwP4phk40w3PCay5rfICVfMeP5tnIQ1f58qEvBOWL6lFk7XiyYzwD4AteOFiSvBvjyC82PFc1CcLVbxH7jJlnR62Lka+t9AamrW8OfMII0Yz/R0pnwdUeGKEOY2OiY+7xCzJre2G3/LXiHpUsABhmyad9QlXUNgvl6P8FEKDZqeDcERnmXRmj1pUgEokrBPWrn+vncQKOWBUO/0DRth0VGz0o0P6Y4o1ml6HvCYzv46nQd3TwM2wBaSNBq6QLh1tI3pi6BpIvxI3AoxEAYz3jHhX1URFTQoK8g6tIyliC8d4j4c8qJaM1whNzKqx9iwNiLIGG2mNRPC3fuwz5P0miQqt1JJJV4HTaHWKUf82H5yoLdVTC7pY1JEHO7X33uKcWf67RBA2aYYA+eWn6Pkf4Kiqv/XNZI0FMygUY4EetF8fUdcyptPRG1bdMoMcXnI1UlYH3B4TyK//GACYTUWYIufXUCG7t+aEgJzMYWSOTlvaWo05Q2XhtszH463dS40WUueG0ab2Yr3/eNyHIRgSqPy5a5dXq+7rgQGR3hzQCWU+t85Ue7f8rtV3VjRHjWL9FB5qFWIkKYSuSiAwI2nNZAZcauRgxW9VwSkKQITPpP4ISHdkLYAaMWRtErzTcv0a7UZ7B9NE8SrR1r28gBjPC2CKy7/azL2jD HcXftNKV lI4sMkl252QFyLvb5au7dYut1RdDRAzNGjZnuMRPhaVrGhWPZ1lWwM7YpiLQTQFrTXeA8e6N03wg6z7+pGxdLMX1ti9MjmDFSAl8GuJBTI5Yp3Wnc3WqFQOKQTBgrLveANNhEXURHBp7dMAxoEt0hDwedQZZ53mrR9vIHDcOkbdSZeck= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 --- 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..fb6d3e2a6395 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 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 usage + This knob is deprecated and shouldn't be + used. hits limits memory.kmem.tcp.max_usage_in_bytes show max tcp buf memory usage recorded + This knob is deprecated and shouldn't be + used. ==================================== ========================================== 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_file *of, ret = 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 = memcg_update_tcp_max(memcg, nr_pages); break; }