Skip to content

mm: fix node reclaim swappiness handling

Ridong cgroups linux-mm lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 14 repliesIn review
  2. v12 patches 13 repliesSuperseded

Changes in v2 from the cover letter

- Move mem_cgroup_swappiness() and vm_swappiness to mm/swap.h instead of include/linux/memcontrol.h. Suggested by Barry Song.
- Correct fix tag for patch 2.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2memcg: move mem_cgroup_swappiness and vm_swappiness to mm/swap.hinclude/linux/memcontrol.h include/linux/swap.h mm/memcontrol.c +1 more+24 -234 replies
2/2mm: vmscan: fix node reclaim ignoring swappiness parametermm/vmscan.c+7 -128 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJohannes WeinerBarry SongQi ZhengSong Hu
1/2A-b R-b R-b
2/2A-b R-b A-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

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

From: Ridong <[email protected]>

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

Patch 1 moves mem_cgroup_swappiness() and vm_swappiness out of the public include/linux/swap.h into the mm-private mm/swap.h, and makes the helper handle both CONFIG_MEMCG and !CONFIG_MEMCG 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.

---

v1 -> v2:
- Move mem_cgroup_swappiness() and vm_swappiness to mm/swap.h instead of include/linux/memcontrol.h. Suggested by Barry Song.
- Correct fix tag for patch 2.

v1: https://lore.kernel.org/all/[email protected]/

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

 include/linux/memcontrol.h |  4 ++--
 include/linux/swap.h       | 19 -------------------
 mm/memcontrol.c            |  4 ++--
 mm/swap.h                  | 20 ++++++++++++++++++++
 mm/vmscan.c                | 19 +++++++------------
 5 files changed, 31 insertions(+), 35 deletions(-)
Signature · 1 line
2.34.1