Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: Add transformation message for per-memcg swappiness

The concept of per-memcg swappiness has never landed well in memcg for
cgroup v2. Add a message to users who use it on v1 hierarchy.
Decreased swappiness transforms to memory.swap.max=0 whereas
increased swappiness transforms into active memory.reclaim operation.

Link: https://lore.kernel.org/r/1577252208-32419-1-git-send-email-teawater@gmail.com/
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Michal Koutný and committed by
Tejun Heo
fd4fd0a8 103149a0

+5 -2
+1
Documentation/admin-guide/cgroup-v1/memory.rst
··· 90 90 used. 91 91 memory.swappiness set/show swappiness parameter of vmscan 92 92 (See sysctl's vm.swappiness) 93 + Per memcg knob does not exist in cgroup v2. 93 94 memory.move_charge_at_immigrate This knob is deprecated. 94 95 memory.oom_control set/show oom controls. 95 96 This knob is deprecated and shouldn't be
+4 -2
mm/memcontrol-v1.c
··· 1855 1855 if (val > MAX_SWAPPINESS) 1856 1856 return -EINVAL; 1857 1857 1858 - if (!mem_cgroup_is_root(memcg)) 1858 + if (!mem_cgroup_is_root(memcg)) { 1859 + pr_info_once("Per memcg swappiness does not exist in cgroup v2. " 1860 + "See memory.reclaim or memory.swap.max there\n ") 1859 1861 WRITE_ONCE(memcg->swappiness, val); 1860 - else 1862 + } else 1861 1863 WRITE_ONCE(vm_swappiness, val); 1862 1864 1863 1865 return 0;