Re: [PATCH 00/11] nodemask: switch to runtime nr_node_ids
From: Yury Norov
Date: Sun Nov 29 2026 - 17:05:18 EST
On Sat, Nov 28, 2026 at 08:20:10PM -0800, Andrew Morton wrote:
> On Sat, 28 Nov 2026 22:01:46 -0500 Yury Norov <ynorov@xxxxxxxxxx> wrote:
>
> > I would suggest another experiment. Let's on the system boot print a
> > message like:
> >
> > The kernel is configured to support for up to 1024 NUMA nodes, while
> > the actual number of nodes on this system is 2. This leaves 99.8% of
> > the allocated resources unused. Please consider reconfiguring.
> >
> > We can show it, say, at 90% rate or higher, and wait until this will start
> > showing up in the people's boot logs. :)
>
> I love it - you're a troll after my own heart.
>
> I guess we could try it as a standalone thing with lots of convincing
> justifications. Are you able to estimate the cost of these wasted
> resources?
Yes, let me think about it for a few days, and I'll figure something
out.
> otoh, I'm sure our downstream have considered all this and have good
> reasons for these configurations so we should find out what those
> reasons are before adding shouty things to dmesg,
I agree with Linus' comment on this.
> ditto NR_CPUS?
>
> Who NR_CPUS
> Mainline default 64
> RHEL 8192
> SUSE 8192
> Oracle UEK 8192
> Ubuntu 8192
> Debian 8192
> Fedora 8192
> AWS (Amazon Linux) 8192
> Google (COS) 512
> Microsoft (Azure Linux) 8192
> Meta unknown
> Tencent (CubeSandbox) 128
>
> Seems that as long as the machine gets nr_cpu_ids reasonably correct,
> the main cost here is one bit/cpu in the task_struct: 1k. Which is not
> insignificant.
In aec6487e994d2, Ingo says each supported CPU eats ~8KB. It's 10 years
old measurements, though. I'll recalculate it myself.
I think, the best solution for distros would be providing whatever
kernel they want (but please better than now), then once loaded build
it against localmodconfig, or similar.
I would like at least to have such an option.
Our local{yes,mod}config doesn't trim NR_CPUS and MAX_NUMNODES to the
actual values, though. The attached patch teaches it to do that.
Thanks,
Yury