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

From: David Hildenbrand (Arm)

Date: Mon Nov 30 2026 - 07:18:16 EST


On 11/30/26 12:51, 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.
>>
>> Yury Norov (11):
>> nodemask: add 'small' and 'large' compile-time sizes
>> nodemask: pass nodemask length to node search functions
>> mm/mempolicy: reject migrate_pages source IDs beyond nr_node_ids
>> mm/mempolicy: preserve full-width userspace nodemasks
>> mm: switch to runtime nodemask length
>> MIPS: IP27: switch nmi_dump to runtime nodemask length
>> ACPI: NUMA: switch acpi_map_pxm_to_node to runtime nodemask length
>> mtip32xx: switch next_online_node() to runtime nodemask length
>> nodemask: add nodes_copy_and_extend()
>> sched/numa: bound cpuset trace masks by nr_node_ids
>> nodemask: add cpumask-style operation size bounds
>>
>> arch/mips/sgi-ip27/ip27-nmi.c | 2 +-
>> drivers/acpi/numa/srat.c | 2 +-
>> drivers/block/mtip32xx/mtip32xx.c | 2 +-
>> include/linux/nodemask.h | 122 +++++++++++++++++++-----------
>> include/trace/events/sched.h | 7 +-
>> mm/hugetlb_internal.h | 2 +-
>> mm/mempolicy.c | 55 +++++++++-----
>> mm/mmzone.c | 2 +-
>> mm/vmscan.c | 2 +-
>> 9 files changed, 123 insertions(+), 73 deletions(-)
>
> 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?

It's not a lot of churn, so we might just be able to squeeze it in. No guarantees :)

--
Cheers,

David