Re: [PATCH 0/9] treewide, numa_memblks: remove redundant work during NUMA init

From: Mike Rapoport

Date: Thu Jul 02 2026 - 06:40:38 EST


Hi,

> Every existing numa_add_memblk() caller passes a valid node id and
> separately marks that node in numa_nodes_parsed with node_set(). In
> addition, numa_nodemask_from_meminfo() recomputes the same "nodes that own
> memory" set from numa_meminfo, which numa_nodes_parsed already contains.
>
> This redundancy implicitly depends on the callers' node_set(). So, before
> removing the redundancy, make numa_add_memblk() set the node in
> numa_nodes_parsed explicitly. Then remove the per-caller node_set() and
> numa_nodemask_from_meminfo().
>
> Also, since the generic numa_register_meminfo() already sets
> node_possible_map to numa_nodes_parsed, remove the duplicate assignment in
> arch_numa's numa_register_nodes().
>
> Patch 1 adds the node_set() to numa_add_memblk() itself, so every memblk's
> node is set in numa_nodes_parsed on add.
>
> Patches 2-6 depend on patch 1 and remove the redundant per-caller node_set()
> from all callers.
>
> Patch 7 removes both numa_nodemask_from_meminfo() call sites and the unused
> function itself.
>
> Patch 8 removes the duplicate node_possible_map assignment in arch_numa.
>
> Patch 9 is a minor cleanup, using the existing numa_add_reserved_memblk()
> wrapper in numa_cleanup_meminfo().
>
> No functional change.

Looks good to me.

Can you please address the small comment for patch 1?

--
Sincerely yours,
Mike.