lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250319064148.774406-6-jingxiangzeng.cas@gmail.com>
Date: Wed, 19 Mar 2025 14:41:48 +0800
From: Jingxiang Zeng <jingxiangzeng.cas@...il.com>
To: akpm@...ux-foundation.org
Cc: linux-mm@...ck.org,
	cgroups@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	hannes@...xchg.org,
	mhocko@...nel.org,
	roman.gushchin@...ux.dev,
	shakeel.butt@...ux.dev,
	muchun.song@...ux.dev,
	kasong@...cent.com,
	Zeng Jingxiang <linuszeng@...cent.com>
Subject: [RFC 5/5] Docs/cgroup-v2: add cgroup.memsw_account_on_dfl Documentation

From: Zeng Jingxiang <linuszeng@...cent.com>

Add documentation descriptions for cgroup.memsw_account_on_dfl and
CONFIG_MEMSW_ACCOUNT_ON_DFL.

Signed-off-by: Zeng Jingxiang <linuszeng@...cent.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ