Skip to contentSkip to conversation

docs: cgroup: mm: Document why inactive_X + active_X may not equal X

PATCH In review Chris Down 2 participants 2 messages Nov 11, 2019

Subsystems (3)
lore
Share & tools
lore

Chris Down

author
#0 lore raw

PATCH 1/1 docs: cgroup: mm: Document why inactive_X + active_X may not equal X

This has confused a significant number of people using cgroups inside Facebook, and some of those outside as well judging by posts like this[0] (although it's not a problem unique to cgroup v2). If shmem handling in particular becomes more coherent at some point in the future -- although that seems unlikely now -- we can change the wording here.

[0]: https://unix.stackexchange.com/q/525092/10762

---
 Documentation/admin-guide/cgroup-v2.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/admin-guide/cgroup-v2.rst +6 -1
index 0704552ed94f..0636bcb60b5a 100644
@@ -1289,7 +1289,12 @@ PAGE_SIZE multiple when read back.
 	  inactive_anon, active_anon, inactive_file, active_file, unevictable
 		Amount of memory, swap-backed and filesystem-backed,
 		on the internal memory management lists used by the
-		page reclaim algorithm
+		page reclaim algorithm.
+
+		As these represent internal list state (eg. shmem pages are on anon
+		memory management lists), inactive_foo + active_foo may not be equal to
+		the value for the foo counter, since the foo counter is type-based, not
+		list-based.
 
 	  slab_reclaimable
 		Part of "slab" that might be reclaimed, such as
Signature · 1 line
2.24.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Chris Down

This has confused a significant number of people using cgroups inside Facebook, and some of those outside as well judging by posts like this[0] (although it's not a problem unique to cgroup v2). If shmem handling in particular becomes more coherent at some point in the future -- although that seems unlikely now -- we can change the wording here.

[0]: https://unix.stackexchange.com/q/525092/10762

Quoted 10 lines
Quoted 9 lines
---
 Documentation/admin-guide/cgroup-v2.rst | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Documentation/admin-guide/cgroup-v2.rst +0 -0
index 0704552ed94f..0636bcb60b5a 100644

Documentation/admin-guide/cgroup-v2.rst PAGE_SIZE multiple when read back. · line 1295

Quoted 8 lines
Documentation/admin-guide/cgroup-v2.rst +4 -1
@@ -1289,7 +1289,12 @@ PAGE_SIZE multiple when read back.
 	  inactive_anon, active_anon, inactive_file, active_file, unevictable
 		Amount of memory, swap-backed and filesystem-backed,
 		on the internal memory management lists used by the
-		page reclaim algorithm
+		page reclaim algorithm.
+
+		As these represent internal list state (eg. shmem pages are on anon
+		memory management lists), inactive_foo + active_foo may not be equal to

and anon will move to file list after MADV_FREE.

Quoted 7 lines
Documentation/admin-guide/cgroup-v2.rst +2 -0
+		the value for the foo counter, since the foo counter is type-based, not
+		list-based.
 
 	  slab_reclaimable
 		Part of "slab" that might be reclaimed, such as
Signature · 1 line
2.24.0
Signature · 2 lines
Michal Hocko
SUSE Labs