Re: [PATCH 00/11] nodemask: switch to runtime nr_node_ids

From: Lorenzo Stoakes (ARM)

Date: Wed Dec 02 2026 - 15:50:46 EST


Yuri - you may have missed the below because it was sent as a follow up to
original feedback, thanks.

On Mon, Nov 30, 2026 at 12:20:00PM +0000, Lorenzo Stoakes (ARM) wrote:
> On Mon, Nov 30, 2026 at 11:51:02AM +0000, Lorenzo Stoakes (ARM) wrote:
> > On Fri, Nov 27, 2026 at 06:01:17PM -0500, Yury Norov wrote:
> > > Nodemasks have a compile-time capacity of MAX_NUMNODES, and
> > > nr_node_ids describes the runtime node ID usage.
> > >
> > > Modern distros, like my Ubuntu, default MAX_NUMNODES to 1024, while the
> > > actual number of nodes is typically smaller. All nodemask functions
> > > currently refer to the MAX_NUMNODES, which adds a substantial overhead
> > > on every traversing operation.
> > >
> > > This series switches the kernel to runtime length of nodemasks, which
> > > also saves up to 8K of .text for minimal config, and accelerates basic
> > > nodemask operations ~4x if MAX_NUMNODES == 1024 and nr_node_ids == 2.
>
> Also, in general, this cover letter is pretty incomplete.
>
> What is the motivation here? Is it purely cleanup? I mean I don't think
> anybody's hitting perf hot paths because of this? Or did you encounter something
> in a real workload that was impacted somehow?
>
> 8K of .text being saved is also surely neither here nor there also? I think if
> it's a cleanup it should say so because 'saves 8K and speeds up operations
> nobody cares about' isn't hugely motivating.
>
> What are the user-visible changes?
>
> Is MAX_NUMNODES retained and used for something else? How do the configs change?
>
> What testing did you do? I do worry about somebody somewhere making assumptions
> about MAX_NR_NODES that this potentially breaks.
>
> Also can hot-onlining CPUs or weird CXL stuff break anything here? Do the locks
> suffice etc.?
>
> Asking claude to dig in it seems like it doesn't touch anything like that, also
> probably worth saying that in the cover letter too.
>
> >
> > Thanks, given the current AI-generated fix onslaught I'm not quite sure if we're
> > looking to take anything non-fixy further this cycle ([0]).
> >
> > David, what do you reckon?
> >
> > --
> > Cheers, Lorenzo
> >
> > [0]: https://lore.kernel.org/linux-mm/a2f584f6-e382-4876-aa6d-d5a34de6ee59@xxxxxxxxxx/
>
> --
> Cheers, Lorenzo

--
Cheers, Lorenzo