From patchwork Wed Aug 14 22:00:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13764177 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 70347C52D7F for ; Wed, 14 Aug 2024 22:00:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EB55D6B00A0; Wed, 14 Aug 2024 18:00:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E64856B00A4; Wed, 14 Aug 2024 18:00:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDE476B00A7; Wed, 14 Aug 2024 18:00:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AD7C86B00A0 for ; Wed, 14 Aug 2024 18:00:32 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3D875A1188 for ; Wed, 14 Aug 2024 22:00:32 +0000 (UTC) X-FDA: 82452220704.13.1B56C31 Received: from out-179.mta1.migadu.com (out-179.mta1.migadu.com [95.215.58.179]) by imf20.hostedemail.com (Postfix) with ESMTP id 8C4511C0025 for ; Wed, 14 Aug 2024 22:00:29 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="k9XxL/qK"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf20.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.179 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=1723672749; 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=Sz+pgwG6Tx1uUhOGcclu4o7yKd27wktU4rb6DA6XtvQ=; b=mI4qFsZnIsxjzpj9z6JCQB8roAV4ZV6LC/XCfw7dH8l9VkAB5WtBOC3ejzHZZPmMc8MyA0 L/Uzy1/bPnRq7xm7x28uNgeqU6I/HxhrxS8vG1fzV4llMkv/ggLLJ+M97KhadVcd6BeimH ESV0itAJ5TsojZ6R3hPTWlFpyg2oACo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723672749; a=rsa-sha256; cv=none; b=3sEfVUA+5mTln60VUA7MY/88eFPyJ5T4MsV5ARCU1uDctYUrFg2Cai6neFROg01sMG86by E9qOqBKbuBT0VOuCovDP9jAgQ5nZA+lTcWB1N24lXPLN/kIb9dYX6a4XEOZUUQHFzLGUel L5fDhe1J14DETtHPDNM14J0NMorIDxU= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="k9XxL/qK"; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf20.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.179 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev 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> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8C4511C0025 X-Stat-Signature: 8xtac1kimof4ydc5wa8qizoptyotqn1k X-Rspam-User: X-HE-Tag: 1723672829-781505 X-HE-Meta: U2FsdGVkX18RRd0AB1AR4xP7GrBMjwuX3KKd8Q1V+4mHsKV7FMvueHCQm+pPZGI9JReahXQHghe3z37WwMcj+4RyFu7ozCa7V4ObYpmtt0KbDE/uD7CFymuHDC1Wa76D1jMGtRPjyhEGpmxYr3ZuS/tjkBTOI6slKlyJCHuXWnVtcxWvyo/V2PJ46c+5AsLc6NdfalNcxK/EuO8SwJfhajnjgGGhMUYvHqqI6c6ici7amTiGETZiewUjzIshHbyxyr0O3nGpVAfy3RN6DebveKsDx1OmGgtOoVUHPFlkP4yo8OC6xZ/2HsxJg+Fv+oBbLIGKjck7KC4h2ko2zGV+I2OuAorOQwdqJfuWhulc+4kevev5qolWQJbbypuRtegF/vQ4psUYm24waEsKWB/oNR3ZlojeaZwtvJCmOz1dfhrD3IWTtVbb7Co4AATgV5D+RZl6TQBzuT/AcrMJOAjSHxB4KJT7x9HGU5iQYtfDAKluNJMvMck66A0hM7SbFG7HfF00LqPqr2qFbo0Rs2KSrjIEgRsckOPoPggDoN2X7tmcadec7Y7EgRZutYQ4EO0LBdz0c7XeruN4ir/umdqPuwWITYozj3Oz5V3k11SMPg0X8m/Dlh9FWSDaswAcvhVJKB7W0N0bjCuGoLv/aIxQvl3K5wjMAxWCE/Aw2s6V1R5vldsCc/+pNZCDChceo1Ct/N26VvTsncfNuYJNczYeIjfafub98zYRNDNcjtM7KqNvv6k378O5MLRw9LKBeKhhBnJLfinUo2f2YHsNKsPlBydgfDcLpDjTnAviAlIzYT6nyNKOx2/SHcBVvdzrcvlNToFsNz+6VqQO+0U6mPFtFD/qNv/8r26YXUYl/onA2iaeMcpjahc9jFJmJ/qoAPZ48NrqyU9pcxCSD2FVy07mQt8pT7U/X7qWCG/mg/dVd3uXb0QoZevPCYo0QQ0AHgS8q5W5XcxHUppwN9/oMPR DOL2vUAW Wzhkh0RkvpwroSigLOaaExkq6s9pLeatzCaCdsIDHv1yNTA6pF7RHy/NkonaK+oiNHTGuMOf+x50oKIc4CxtuZw5/5VBnI96AkiLAfddmrvZ7Kp07BwdxsYSusn+D5TdCIINwD+SPMSIP4jym87V0VXMqLV0+v+5uHxFF/dNaYrNIrr7X61k4vwfw19VPopXt34gE 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 --- 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 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 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. ==================================== ========================================== 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; }