diff options
| author | Gregory Price <gourry@gourry.net> | 2026-09-22 22:29:01 -0400 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-10-08 22:55:12 -0700 |
| commit | 5436132610d94167c44cfe308359d322dd53e2f2 (patch) | |
| tree | b1a1f7c61ba9b74a7bb60afe374373e3bba289a4 /include/linux/timerqueue.h | |
| parent | 0bd719cb607ef14bcd554e044bbd80dd901b9996 (diff) | |
| download | linux-5436132610d94167c44cfe308359d322dd53e2f2.tar.gz linux-5436132610d94167c44cfe308359d322dd53e2f2.zip | |
mm: refactor find_next_best_node to find_next_best_node_in
Patch series "mm: refactor zonelist constructors and iterators", v3.
find_next_best_node() picks the next-closest node when building a fallback
list, and hardcodes N_MEMORY as the set it picks from.
Refactor it into find_next_best_node_in(), which takes the candidate set
explicitly.
This makes the existing behaviour explicit at both mm/memory-tiers.c call
sites - they select demotion targets in fallback order from N_MEMORY - and
lets callers narrow that set.
Then extract the per-node construction loop out of build_zonelists() into
build_node_zonelist(), parameterised on the candidate nodemask and
destination zonelist index.
Together these allow a zonelist to be built over a candidate set other
than N_MEMORY, into a zonelist other than FALLBACK, and iterated in
fallback order over a caller-defined subset.
These are prerequisites for generating a private node zonelist (nodes
unreachable by default), but are otherwise general improvements to the
existing interfaces so I'm proposing them separately.
No functional change intended - purely refactor commits.
This patch (of 2):
find_next_best_node() picks the next-closest node for a fallback list
from the full N_MEMORY set. Refactor it into find_next_best_node_in(),
which takes an explicit candidates nodemask.
This enables building fallback lists with non-N_MEMORY candidates.
No functional change: every caller still selects from N_MEMORY.
Link: https://lore.kernel.org/20260923022902.2433614-1-gourry@gourry.net
Link: https://lore.kernel.org/20260923022902.2433614-2-gourry@gourry.net
Signed-off-by: Gregory Price <gourry@gourry.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Acked-by: Balbir Singh <balbirs@nvidia.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>
Cc: David Hildenbrand <david@kernel.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Rakie Kim <rakie.kim@sk.com>
Cc: Ying Huang <ying.huang@linux.alibaba.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions
