Re: [RFC PATCH] futex: Dynamically allocate futex_queues depending on nr_node_ids

From: K Prateek Nayak

Date: Fri Feb 27 2026 - 11:11:15 EST


Hello Sebastian,

On 2/27/2026 8:45 PM, Sebastian Andrzej Siewior wrote:
>>> Sounds like it. What would be sane default upper limit then? Something
>>> like 1024 CPUs? 2048? Or even more than that?
>>
>> I feel the current default for NR_CPUS can be be retained as is just to
>> be on the safer side.
>>
>> Turns out QEMU allows for a ridiculous amount of vCPUs per guest and I've
>> found enough evidence of extremely large guests running oversubscribed
>> that sometimes run distro kernels :-(
>
> You mean distro kernel in 8k CPUs guest? I do this kind of things for
> testing but not with a distro kernel. Oh well.

I bet there are interesting justifications with stuff like live
migration, reliability, etc. but I haven't dared to ask!

>
>> I'll let you decide what is a good trade off between space saving and
>> future headaches :-)
>
> So you are saying NODES_SHIFT=8 and NR_CPUS=4k is what should be default
> given "sane" upper limits as of today?

Yup those seem sane in my opinion and amounts to a decent chunk of
space saved.

> I did hope for SHIFT 6 & NR=2k. Not sure this is worth fighting for.

We leave a little buffer for insanity ;-)

--
Thanks and Regards,
Prateek