Commit fd4fd0a8 authored by Michal Koutný's avatar Michal Koutný Committed by Tejun Heo
Browse files

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: default avatarMichal Koutný <mkoutny@suse.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent 103149a0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ Brief summary of control files.
                                     used.
 memory.swappiness		     set/show swappiness parameter of vmscan
				     (See sysctl's vm.swappiness)
				     Per memcg knob does not exist in cgroup v2.
 memory.move_charge_at_immigrate     This knob is deprecated.
 memory.oom_control		     set/show oom controls.
                                     This knob is deprecated and shouldn't be
+4 −2
Original line number Diff line number Diff line
@@ -1855,9 +1855,11 @@ static int mem_cgroup_swappiness_write(struct cgroup_subsys_state *css,
	if (val > MAX_SWAPPINESS)
		return -EINVAL;

	if (!mem_cgroup_is_root(memcg))
	if (!mem_cgroup_is_root(memcg)) {
		pr_info_once("Per memcg swappiness does not exist in cgroup v2. "
			     "See memory.reclaim or memory.swap.max there\n ")
		WRITE_ONCE(memcg->swappiness, val);
	else
	} else
		WRITE_ONCE(vm_swappiness, val);

	return 0;