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 2/2] mm/memblock: switch to use NUMA_NO_NODE instead of MAX_NUMNODES in for_each_mem_pfn_range()
Date: Fri, 27 Jan 2017 09:59:22 +0800 [thread overview]
Message-ID: <20170127015922.36249-2-richard.weiyang@gmail.com> (raw)
In-Reply-To: <20170127015922.36249-1-richard.weiyang@gmail.com>
As in commit <b115423357e0> '(mm/memblock: switch to use NUMA_NO_NODE
instead of MAX_NUMNODES)', NUMA_NO_NODE is recommended to be the selector
of the nid.
This patch does the same thing.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
include/linux/memblock.h | 2 +-
mm/memblock.c | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 5b759c9acf97..4bf9d3f7c539 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -207,7 +207,7 @@ void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
/**
* for_each_mem_pfn_range - early memory pfn range iterator
* @i: an integer used as loop variable
- * @nid: node selector, %MAX_NUMNODES for all nodes
+ * @nid: node selector, %NUMA_NO_NODE for all nodes
* @p_start: ptr to ulong for start pfn of the range, can be %NULL
* @p_end: ptr to ulong for end pfn of the range, can be %NULL
* @p_nid: ptr to int for nid of the range, can be %NULL
diff --git a/mm/memblock.c b/mm/memblock.c
index 7d27566cee11..8d41421aa589 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1084,12 +1084,16 @@ void __init_memblock __next_mem_pfn_range(int *idx, int nid,
struct memblock_type *type = &memblock.memory;
struct memblock_region *r;
+ if (WARN_ONCE(nid == MAX_NUMNODES,
+ "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
+ nid = NUMA_NO_NODE;
+
while (++*idx < type->cnt) {
r = &type->regions[*idx];
if (PFN_UP(r->base) >= PFN_DOWN(r->base + r->size))
continue;
- if (nid == MAX_NUMNODES || nid == r->nid)
+ if (nid == NUMA_NO_NODE || nid == r->nid)
break;
}
if (*idx >= type->cnt) {
--
2.11.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-01-27 1:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-27 1:59 [PATCH 1/2] mm/memblock: use NUMA_NO_NODE instead of MAX_NUMNODES as default node_id Wei Yang
2017-01-27 1:59 ` Wei Yang [this message]
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-2-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).