[PATCH 0/2] mm: fix node reclaim swappiness handling

From: Ridong Chen

Date: Sat Jul 11 2026 - 05:14:07 EST


From: Ridong Chen <chenridong@xxxxxxxxxx>

The per-node proactive reclaim interface
(/sys/devices/system/node/nodeX/reclaim) accepts a swappiness parameter,
but it was silently ignored when CONFIG_MEMCG is disabled. The root cause
is that sc_swappiness() had separate implementations for CONFIG_MEMCG and
!CONFIG_MEMCG, and the latter never checked proactive_swappiness.

Patch 1 moves mem_cgroup_swappiness() from swap.h to memcontrol.h and
makes it handle both CONFIG_MEMCG and !CONFIG_MEMCG cases in a single
inline function. This is a prerequisite for unifying sc_swappiness().

Patch 2 consolidates sc_swappiness() into a single definition that
works regardless of CONFIG_MEMCG, fixing the node reclaim swappiness
bug.

Ridong Chen (2):
memcg: move mem_cgroup_swappiness to memcontrol.h
mm: vmscan: fix node reclaim ignoring swappiness parameter

include/linux/memcontrol.h | 25 +++++++++++++++++++++++--
include/linux/swap.h | 19 -------------------
mm/memcontrol.c | 3 +--
mm/vmscan.c | 17 +++++++----------
4 files changed, 31 insertions(+), 33 deletions(-)

--
2.43.0