linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jingxiang Zeng <jingxiangzeng.cas@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, cgroups@vger.kernel.org,
	linux-kernel@vger.kernel.org, hannes@cmpxchg.org,
	mhocko@kernel.org, roman.gushchin@linux.dev,
	shakeel.butt@linux.dev, muchun.song@linux.dev,
	kasong@tencent.com, Zeng Jingxiang <linuszeng@tencent.com>
Subject: [RFC 5/5] Docs/cgroup-v2: add cgroup.memsw_account_on_dfl Documentation
Date: Wed, 19 Mar 2025 14:41:48 +0800	[thread overview]
Message-ID: <20250319064148.774406-6-jingxiangzeng.cas@gmail.com> (raw)
In-Reply-To: <20250319064148.774406-1-jingxiangzeng.cas@gmail.com>

From: Zeng Jingxiang <linuszeng@tencent.com>

Add documentation descriptions for cgroup.memsw_account_on_dfl and
CONFIG_MEMSW_ACCOUNT_ON_DFL.

Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com>
---
 Documentation/admin-guide/cgroup-v2.rst       | 21 +++++++++++++++----
 .../admin-guide/kernel-parameters.txt         |  7 +++++++
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index 53ada5c2620a..58869279f0a9 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1704,8 +1704,14 @@ The following nested keys are defined.
 	A read-only single value file which exists on non-root
 	cgroups.
 
-	The total amount of swap currently being used by the cgroup
-	and its descendants.
+	If memsw_account_on_dfl and CONFIG_MEMSW_ACCOUNT_ON_DFL is not
+	enabled (the default), this interface represents the total
+	amount of swap currently being used by the cgroup and its
+	descendants.
+
+	If memsw_account_on_dfl or CONFIG_MEMSW_ACCOUNT_ON_DFL is enabled,
+	this interface represents the total amount of memory+swap
+	currently being used by the cgroup and its descendants.
 
   memory.swap.high
 	A read-write single value file which exists on non-root
@@ -1737,8 +1743,15 @@ The following nested keys are defined.
 	A read-write single value file which exists on non-root
 	cgroups.  The default is "max".
 
-	Swap usage hard limit.  If a cgroup's swap usage reaches this
-	limit, anonymous memory of the cgroup will not be swapped out.
+	If memsw_account_on_dfl and CONFIG_MEMSW_ACCOUNT_ON_DFL is not
+	enabled (the default), this interface represents the hard limit
+	of swap usage. If a cgroup's swap usage reaches this limit,
+	anonymous memory of the cgroup will not be swapped out.
+
+	If memsw_account_on_dfl or CONFIG_MEMSW_ACCOUNT_ON_DFL is enabled,
+	this interface represents the hard limit of memory+swap usage.
+	If a cgroup's memory+swap usage reaches this limit, anonymous
+	memory of the cgroup will not be swapped out.
 
   memory.swap.max.effective
 	A read-only single value file which exists on non-root cgroups.
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 2758bc124f16..0aa9e4f85b51 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -644,6 +644,13 @@
 			nokmem -- Disable kernel memory accounting.
 			nobpf -- Disable BPF memory accounting.
 
+	cgroup.memsw_account_on_dfl= [KNL] Enable memory+swap account on cgroupv2.
+			Format: { "0" | "1" }
+			0 - memory.swap.current and memory.swap.max represents the
+				usage/limit of swap.
+			1 - memory.swap.current and memory.swap.max represents the
+				usage/limit of memory+swap.
+
 	checkreqprot=	[SELINUX] Set initial checkreqprot flag value.
 			Format: { "0" | "1" }
 			See security/selinux/Kconfig help text.
-- 
2.41.1



  parent reply	other threads:[~2025-03-19  6:42 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19  6:41 [RFC 0/5] add option to restore swap account to cgroupv1 mode Jingxiang Zeng
2025-03-19  6:41 ` [RFC 1/5] Kconfig: add SWAP_CHARGE_V1_MODE config Jingxiang Zeng
2025-03-19 19:29   ` Shakeel Butt
2025-03-19 19:31     ` Shakeel Butt
2025-03-19  6:41 ` [RFC 2/5] memcontrol: add boot option to enable memsw account on dfl Jingxiang Zeng
2025-03-19 19:34   ` Shakeel Butt
2025-03-19 22:30     ` Roman Gushchin
2025-03-20  8:43       ` jingxiang zeng
2025-03-20 14:28       ` Johannes Weiner
2025-03-20 15:16         ` Roman Gushchin
2025-03-20 15:33         ` Shakeel Butt
2025-04-02 13:40           ` Michal Koutný
2025-04-03  7:47             ` [External] " Zhongkun He
2025-04-03  9:16               ` jingxiang zeng
2025-04-11 16:57                 ` Michal Koutný
2025-04-16  8:29                   ` jingxiang zeng
2025-05-05 18:29                     ` Michal Koutný
2025-03-20  8:51     ` jingxiang zeng
2025-03-19  6:41 ` [RFC 3/5] mm/memcontrol: do not scan anon pages if memsw limit is hit Jingxiang Zeng
2025-03-19 19:36   ` Shakeel Butt
2025-03-20  8:40     ` jingxiang zeng
2025-03-19  6:41 ` [RFC 4/5] mm/memcontrol: allow memsw account in cgroup v2 Jingxiang Zeng
2025-03-19  6:41 ` Jingxiang Zeng [this message]
2025-03-19 19:27 ` [RFC 0/5] add option to restore swap account to cgroupv1 mode Shakeel Butt
2025-03-19 19:38 ` Johannes Weiner
2025-03-19 19:51   ` Shakeel Butt
2025-03-20  8:09   ` jingxiang zeng
2025-03-20 15:08     ` Johannes Weiner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250319064148.774406-6-jingxiangzeng.cas@gmail.com \
    --to=jingxiangzeng.cas@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kasong@tencent.com \
    --cc=linuszeng@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeel.butt@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox