Skip to content

mm/vmscan: optimize preferred target demotion node selection

Bing Jiao linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2mm/vmscan: balance demotion allocation in alloc_demote_folio()mm/vmscan.c+5 -04 replies
2/2mm/vmscan: select the closest perferred node in demote_folio_list()mm/vmscan.c+12 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/2] mm/vmscan: optimize preferred target demotion node selection

In tiered memory systems, the demotion aims to move cold folios to the far-tier nodes. To maintain system performance, the demotion target should ideally be the node with the shortest NUMA distance from the source node.

However, the current implementation has two suboptimal behaviors:

1. Unbalanced Fallback: When the primary preferred demotion node is full, the allocator falls back to other nodes in a way that often skews toward zones that closer to the primary preferred node rather than distributing the load evenly across fallback nodes.

2. Suboptimal Target Selection: demote_folio_list() randomly select a preferred node from the allowed mask, potentially selecting a very distant node.

This series optimizes the selection logic while ensuring balanced allocation across fallback nodes.

Patch 1/2 introduces a randomized fallback mechanism in alloc_demote_folio() to prevent allocation hotspots when the preferred node is under memory pressure.

Patch 2/2 updates demote_folio_list() to traverse the demotion targets hierarchically, ensuring the perferred target is always the closest available node.

Dependencies:

1. Patch 1/2 has no dependencies.

2. Patch 2/2 depends on commit d7138516fb5c ("mm/vmscan: fix demotion targets checks in reclaim/demotion").

Bing Jiao (2):
mm/vmscan: balance demotion allocation in alloc_demote_folio() mm/vmscan: select the optimal perferred node in demote_folio_list()

 mm/vmscan.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

--
2.52.0.358.g0dd7633a29-goog