From: Sang-Heon Jeon <ekffu200098@gmail.com>
To: akpm@linux-foundation.org, Yury Norov <yury.norov@gmail.com>,
Vlastimil Babka <vbabka@kernel.org>
Cc: linux-mm@kvack.org, Sang-Heon Jeon <ekffu200098@gmail.com>,
Andreas Larsson <andreas@gaisler.com>,
Brendan Jackman <jackmanb@google.com>,
"David S. Miller" <davem@davemloft.net>,
Johannes Weiner <hannes@cmpxchg.org>,
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
linux-kernel@vger.kernel.org,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Michal Hocko <mhocko@suse.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Rich Felker <dalias@libc.org>,
Suren Baghdasaryan <surenb@google.com>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Zi Yan <ziy@nvidia.com>
Subject: [PATCH 4/4] mm/page_alloc: initialize node_possible_map like the other node maps
Date: Thu, 2 Jul 2026 02:18:51 +0900 [thread overview]
Message-ID: <20260701171851.2447626-5-ekffu200098@gmail.com> (raw)
In-Reply-To: <20260701171851.2447626-1-ekffu200098@gmail.com>
node_states[N_POSSIBLE], aliased by node_possible_map, is initialized to
NODE_MASK_ALL, unlike the other entries, which are initialized with only
node 0 set.
On !NUMA, MAX_NUMNODES == 1, so initializing node_possible_map to
NODE_MASK_ALL is equivalent to initializing it with only node 0 set.
On NUMA, every architecture now sets node_possible_map after parsing its
NUMA topology, so nothing relies on the initial value.
So, instead of initializing node_possible_map to NODE_MASK_ALL, set only
node 0, like the other entries. Then NODE_MASK_ALL is no longer used, so
remove it and its only helper NODE_MASK_LAST_WORD.
No functional change.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
include/linux/nodemask.h | 20 --------------------
mm/page_alloc.c | 2 +-
2 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index b842aa525546..484fe366a94c 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -47,7 +47,6 @@
* MAX_NUMNODES
*
* nodemask_t nodemask_of_node(node) Return nodemask with bit 'node' set
- * NODE_MASK_ALL Initializer - all bits set
* NODE_MASK_NONE Initializer - no bits set
* unsigned long *nodes_addr(mask) Array of unsigned long's in mask
*
@@ -296,25 +295,6 @@ static __always_inline unsigned int __first_unset_node(const nodemask_t *maskp)
return min(MAX_NUMNODES, find_first_zero_bit(maskp->bits, MAX_NUMNODES));
}
-#define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES)
-
-#if MAX_NUMNODES <= BITS_PER_LONG
-
-#define NODE_MASK_ALL \
-((nodemask_t) { { \
- [BITS_TO_LONGS(MAX_NUMNODES)-1] = NODE_MASK_LAST_WORD \
-} })
-
-#else
-
-#define NODE_MASK_ALL \
-((nodemask_t) { { \
- [0 ... BITS_TO_LONGS(MAX_NUMNODES)-2] = ~0UL, \
- [BITS_TO_LONGS(MAX_NUMNODES)-1] = NODE_MASK_LAST_WORD \
-} })
-
-#endif
-
#define NODE_MASK_NONE \
((nodemask_t) { { \
[0 ... BITS_TO_LONGS(MAX_NUMNODES)-1] = 0UL \
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 784a6e2f8ba0..c0f17dede824 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -191,7 +191,7 @@ EXPORT_SYMBOL(latent_entropy);
* Array of node states.
*/
nodemask_t node_states[NR_NODE_STATES] __read_mostly = {
- [N_POSSIBLE] = NODE_MASK_ALL,
+ [N_POSSIBLE] = { { [0] = 1UL } },
[N_ONLINE] = { { [0] = 1UL } },
#ifndef CONFIG_NUMA
[N_NORMAL_MEMORY] = { { [0] = 1UL } },
--
2.43.0
prev parent reply other threads:[~2026-07-01 17:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 17:18 [PATCH 0/4] treewide, mm: initialize node_possible_map like the other node maps Sang-Heon Jeon
2026-07-01 17:18 ` [PATCH 1/4] sparc64: set node_possible_map in bootmem_init_numa() Sang-Heon Jeon
2026-07-01 17:18 ` [PATCH 2/4] sh: set node_possible_map in do_init_bootmem() Sang-Heon Jeon
2026-07-01 17:18 ` [PATCH 3/4] powerpc/numa: set node_possible_map from node_online_map Sang-Heon Jeon
2026-07-01 20:55 ` Yury Norov
2026-07-02 3:57 ` Sang-Heon Jeon
2026-07-02 6:35 ` Yury Norov
2026-07-01 17:18 ` Sang-Heon Jeon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260701171851.2447626-5-ekffu200098@gmail.com \
--to=ekffu200098@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andreas@gaisler.com \
--cc=dalias@libc.org \
--cc=davem@davemloft.net \
--cc=glaubitz@physik.fu-berlin.de \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=maddy@linux.ibm.com \
--cc=mhocko@suse.com \
--cc=mpe@ellerman.id.au \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=ysato@users.sourceforge.jp \
--cc=yury.norov@gmail.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox