linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] mm/vmscan: optimize preferred target demotion node selection
@ 2026-01-07  7:28 Bing Jiao
  2026-01-07  7:28 ` [PATCH v1 1/2] mm/vmscan: balance demotion allocation in alloc_demote_folio() Bing Jiao
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Bing Jiao @ 2026-01-07  7:28 UTC (permalink / raw)
  To: linux-mm
  Cc: Bing Jiao, Andrew Morton, Johannes Weiner, David Hildenbrand,
	Michal Hocko, Qi Zheng, Shakeel Butt, Lorenzo Stoakes,
	Axel Rasmussen, Yuanchu Xie, Wei Xu, linux-kernel

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-10  0:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-07  7:28 [PATCH v1 0/2] mm/vmscan: optimize preferred target demotion node selection Bing Jiao
2026-01-07  7:28 ` [PATCH v1 1/2] mm/vmscan: balance demotion allocation in alloc_demote_folio() Bing Jiao
2026-01-08 12:44   ` Donet Tom
2026-01-09 23:45     ` Bing Jiao
2026-01-10  0:52       ` Joshua Hahn
2026-01-07  7:28 ` [PATCH v1 2/2] mm/vmscan: select the closest perferred node in demote_folio_list() Bing Jiao
2026-01-07 17:39 ` [PATCH v1 0/2] mm/vmscan: optimize preferred target demotion node selection Andrew Morton
2026-01-07 17:46 ` Joshua Hahn
2026-01-08  6:03   ` Bing Jiao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox