Re: [PATCH 2/2] mm/page_alloc: refactor build_node_zonelist() out of build_zonelists()

From: Gregory Price

Date: Thu Sep 03 2026 - 12:14:21 EST


On Thu, Sep 03, 2026 at 05:33:42PM +0200, Vlastimil Babka (SUSE) wrote:
> On 9/2/26 23:58, Gregory Price wrote:
> > Extract per-node fallback-list construction into build_node_zonelist().
> >
> > This lets us build new zonelists from candidate nodemasks instead of
> > just the default N_MEMORY node state list.
> >
> > No functional change: build_zonelists() builds the same FALLBACK list over
> > N_MEMORY with node_load updates as before.
> >
> > Signed-off-by: Gregory Price <gourry@xxxxxxxxxx>
>
> LGTM, but, while we're at it, could we just do the pr_cont() printing in
> build_node_zonelist() itself (maybe behind a flag if you don't want to print
> from future new caller) so it doesn't need to pass nr_nodes back to
> build_zonelists(). Then also the node_order array could live in
> build_node_zonelist() itself?
>

Seems trivial enough, will let this sit for a minute and spin a v2.

> Actually I wonder if we could get ride of the node_order array completely.
> It would mean the loop processing in build_zonelists_in_node_order() would
> have to be done piece-meal in build_node_zonelist() itself. But seems
> feasible? Depends on how you intend to reuse/extend the new functions later,
> I guess...
>

I can take a look. We've been testing a couple different things, will
see how well things generalize (private node fallback lists, inverted
fallback lists for proactive reclaim node ordering, some other stuff).

~Gregory