Skip to content

treewide, mm: initialize node_possible_map like the other node maps

Sang-Heon Jeon linux-mm linux-sh linuxppc-dev lkml sparclinux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4sparc64: set node_possible_map in bootmem_init_numa()arch/sparc/mm/init_64.c+2 -00 replies
2/4sh: set node_possible_map in do_init_bootmem()arch/sh/mm/init.c+2 -00 replies
3/4powerpc/numa: set node_possible_map from node_online_maparch/powerpc/mm/numa.c+1 -13 replies
4/4mm/page_alloc: initialize node_possible_map like the other node mapsinclude/linux/nodemask.h mm/page_alloc.c+1 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] treewide, mm: initialize node_possible_map like the other node maps

While reviewing an earlier series [1], Andrew asked why we carefully initialize node_possible_map at compile time, then zero it within __init code anyway.

node_possible_map, aliased by node_states[N_POSSIBLE], is initialized to NODE_MASK_ALL at compile time, unlike the other entries, which are initialized with only node 0 set.

Architectures that use numa_memblks set node_possible_map from numa_nodes_parsed, so the compile-time value is meaningless for them.

However, a few architectures that do not use numa_memblks do not set node_possible_map on their own. Once these architectures set node_possible_map to match their own topology, the NODE_MASK_ALL initialization can be removed.

Patches 1-2 handle sparc64 and sh, which do not set node_possible_map themselves. Both set node_online_map from their topology, so set node_possible_map from node_online_map.

Patch 3 handles powerpc, which sets node_possible_map by intersecting it with node_online_map. Nothing sets node_possible_map before this, so it is still NODE_MASK_ALL and the intersection is just node_online_map. Once patch 4 changes that initial value, the intersection would no longer be node_online_map, so assign node_online_map directly.

Patch 4 initializes node_possible_map with only node 0 set, like the other node_states[] entries. NODE_MASK_ALL is then no longer used, so remove it and its only helper NODE_MASK_LAST_WORD.

[1] https://lore.kernel.org/all/[email protected]/

Sang-Heon Jeon (4):
sparc64: set node_possible_map in bootmem_init_numa()
sh: set node_possible_map in do_init_bootmem() powerpc/numa: set node_possible_map from node_online_map mm/page_alloc: initialize node_possible_map like the other node maps

 arch/powerpc/mm/numa.c   |  2 +-
 arch/sh/mm/init.c        |  2 ++
 arch/sparc/mm/init_64.c  |  2 ++
 include/linux/nodemask.h | 20 --------------------
 mm/page_alloc.c          |  2 +-
 5 files changed, 6 insertions(+), 22 deletions(-)
Signature · 1 line
2.43.0