Skip to content

RFC mm/vmscan: honour node reclaim limits per type

Ridong Chen linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm/vmscan: only reclaim slab in node reclaim when over min_slab_pagesmm/vmscan.c+20 -30 replies
2/4mm/vmscan: only reclaim file pages in node reclaim when over min_unmapped_pagesmm/vmscan.c+35 -30 replies
3/4mm/vmscan: drop the combined limit gate in __node_reclaim()mm/vmscan.c+10 -102 replies
4/4mm/vmscan: do not skip node reclaim when only anon is reclaimablemm/vmscan.c+5 -90 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchJohannes Weiner
1/4
2/4
3/4A-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/4] mm/vmscan: honour node reclaim limits per type

From: Ridong Chen <[email protected]>

min_unmapped_pages and min_slab_pages are documented as per-type limits, but node reclaim treats them as one combined gate: once either is exceeded, shrink_node() reclaims slab, file and anon together and pushes the other type below its limit. Per-node proactive reclaim reuses the same gate and fares worse -- with page cache and slab both under their limits it reclaims nothing and returns -EAGAIN on an anon-heavy node [1].

This series gates each type separately via two scan_control flags (skip_slab_reclaim, skip_file_reclaim) set only on the node reclaim path, drops the combined gate, and extends node_reclaim()'s early bail to check anon. The flags default to zero, so kswapd, direct, memcg and drop_caches are unaffected.

Tested on QEMU (x86_64, 2 NUMA nodes), A/B kernels differing only in this series.

Proactive reclaim (echo to node/reclaim) on an anon-heavy node, file and slab under their limits:

  metric              before   after
  -----------------   ------   -----------
  pages reclaimed     0 MiB    254 MiB anon
  return value        -EAGAIN  0

Node reclaim (zone_reclaim_mode) with one type under its limit -- the type under its limit must be left alone:

  type under limit    before          after
  -----------------   -------------   --------
  slab                645 scans       0 scans
  page cache          83 MiB scanned  0 MiB

[1] https://sashiko.dev/#/patchset/[email protected]

Ridong Chen (4):
mm/vmscan: only reclaim slab in node reclaim when over min_slab_pages mm/vmscan: only reclaim file pages in node reclaim when over
min_unmapped_pages
mm/vmscan: drop the combined limit gate in __node_reclaim() mm/vmscan: do not skip node reclaim when only anon is reclaimable

 mm/vmscan.c | 89 ++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 67 insertions(+), 22 deletions(-)
Signature · 1 line
2.34.1