From: Wei Yang <richard.weiyang@gmail.com>
To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Wei Yang <richard.weiyang@gmail.com>
Subject: [PATCH 1/2] mm/memblock: use NUMA_NO_NODE instead of MAX_NUMNODES as default node_id
Date: Fri, 27 Jan 2017 09:59:21 +0800 [thread overview]
Message-ID: <20170127015922.36249-1-richard.weiyang@gmail.com> (raw)
According to commit <b115423357e0> ('mm/memblock: switch to use
NUMA_NO_NODE instead of MAX_NUMNODES'), MAX_NUMNODES is not preferred as an
node_id indicator.
This patch use NUMA_NO_NODE as the default node_id for memblock.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
arch/x86/mm/numa.c | 6 +++---
mm/memblock.c | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 3f35b48d1d9d..4366242356c5 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -506,7 +506,7 @@ static void __init numa_clear_kernel_node_hotplug(void)
* reserve specific pages for Sandy Bridge graphics. ]
*/
for_each_memblock(reserved, mb_region) {
- if (mb_region->nid != MAX_NUMNODES)
+ if (mb_region->nid != NUMA_NO_NODE)
node_set(mb_region->nid, reserved_nodemask);
}
@@ -633,9 +633,9 @@ static int __init numa_init(int (*init_func)(void))
nodes_clear(node_online_map);
memset(&numa_meminfo, 0, sizeof(numa_meminfo));
WARN_ON(memblock_set_node(0, ULLONG_MAX, &memblock.memory,
- MAX_NUMNODES));
+ NUMA_NO_NODE));
WARN_ON(memblock_set_node(0, ULLONG_MAX, &memblock.reserved,
- MAX_NUMNODES));
+ NUMA_NO_NODE));
/* In case that parsing SRAT failed. */
WARN_ON(memblock_clear_hotplug(0, ULLONG_MAX));
numa_reset_distance();
diff --git a/mm/memblock.c b/mm/memblock.c
index d0f2c9632187..7d27566cee11 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -292,7 +292,7 @@ static void __init_memblock memblock_remove_region(struct memblock_type *type, u
type->regions[0].base = 0;
type->regions[0].size = 0;
type->regions[0].flags = 0;
- memblock_set_region_node(&type->regions[0], MAX_NUMNODES);
+ memblock_set_region_node(&type->regions[0], NUMA_NO_NODE);
}
}
@@ -616,7 +616,7 @@ int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
(unsigned long long)base + size - 1,
0UL, (void *)_RET_IP_);
- return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0);
+ return memblock_add_range(&memblock.memory, base, size, NUMA_NO_NODE, 0);
}
/**
@@ -734,7 +734,7 @@ int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
(unsigned long long)base + size - 1,
0UL, (void *)_RET_IP_);
- return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0);
+ return memblock_add_range(&memblock.reserved, base, size, NUMA_NO_NODE, 0);
}
/**
@@ -1684,7 +1684,7 @@ static void __init_memblock memblock_dump(struct memblock_type *type, char *name
size = rgn->size;
flags = rgn->flags;
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
- if (memblock_get_region_node(rgn) != MAX_NUMNODES)
+ if (memblock_get_region_node(rgn) != NUMA_NO_NODE)
snprintf(nid_buf, sizeof(nid_buf), " on node %d",
memblock_get_region_node(rgn));
#endif
--
2.11.0
next reply other threads:[~2017-01-27 2:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 1:59 Wei Yang [this message]
2017-01-27 1:59 ` [PATCH 2/2] mm/memblock: switch to use NUMA_NO_NODE instead of MAX_NUMNODES in for_each_mem_pfn_range() Wei Yang
2017-02-03 1:44 ` [lkp-robot] [mm/memblock] cc4a913fa5: WARNING:at_mm/memblock.c:#__next_mem_pfn_range kernel test robot
2017-02-04 16:27 ` Wei Yang
2017-02-06 1:46 ` Ye Xiaolong
2017-02-06 15:12 ` Wei Yang
2017-02-04 16:45 ` Wei Yang
2017-02-28 7:00 ` [PATCH 1/2] mm/memblock: use NUMA_NO_NODE instead of MAX_NUMNODES as default node_id Wei Yang
2017-03-09 3:44 ` Wei Yang
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=20170127015922.36249-1-richard.weiyang@gmail.com \
--to=richard.weiyang@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).