From: Michael Bringmann <mwb@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Michael Bringmann <mwb@linux.vnet.ibm.com>,
John Allen <jallen@linux.vnet.ibm.com>,
Nathan Fontenot <nfont@linux.vnet.ibm.com>,
Tyrel Datwyler <tyreld@linux.vnet.ibm.com>,
Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Subject: [PATCH V2 2/3] pseries/findnodes: Find nodes with memory for memoryless nodes
Date: Wed, 18 Oct 2017 15:09:01 -0500 [thread overview]
Message-ID: <bcccffb8-8472-463d-cca5-698db5cbc8e1@linux.vnet.ibm.com> (raw)
In-Reply-To: <cd1c9d3f-c828-2477-ff31-fb6277a8a2aa@linux.vnet.ibm.com>
pseries/findnodes: On pseries systems which allow 'hot-add' of
resources, we may boot configurations that have CPUs, but no memory
associated to a node by the affinity calculations. Previously, the
software took a shortcut to collapse initialization and references
to such memoryless nodes with other nodes that did have memory
associated with them at boot. This patch is based on fixes that
allow the proper initialization and distinguishment of memoryless
and memory-plus nodes after NUMA initialization. It extends the
use of the 'node_to_mem_node()' API from 'topology.h' to modules
that are allocating node-specific memory at boot, and allows such
references to find available memory in another node.
Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
block/blk-mq-cpumap.c | 3 ++-
mm/page_alloc.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/blk-mq-cpumap.c b/block/blk-mq-cpumap.c
index 9f8cffc..a27a31f 100644
--- a/block/blk-mq-cpumap.c
+++ b/block/blk-mq-cpumap.c
@@ -73,7 +73,8 @@ int blk_mq_hw_queue_to_node(unsigned int *mq_map, unsigned int index)
for_each_possible_cpu(i) {
if (index == mq_map[i])
- return local_memory_node(cpu_to_node(i));
+ return local_memory_node(
+ node_to_mem_node(cpu_to_node(i)));
}
return NUMA_NO_NODE;
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 77e4d3c..e7aaa2a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4188,6 +4188,7 @@ struct page *
gfp_mask &= gfp_allowed_mask;
alloc_mask = gfp_mask;
+ preferred_nid = node_to_mem_node(preferred_nid);
if (!prepare_alloc_pages(gfp_mask, order, preferred_nid, nodemask, &ac, &alloc_mask, &alloc_flags))
return NULL;
next prev parent reply other threads:[~2017-10-18 20:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-18 20:08 [PATCH V2 0/3] pseries/nodes: Fix issues with memoryless nodes Michael Bringmann
2017-10-18 20:08 ` [PATCH V2 1/3] pseries/nodes: Ensure enough nodes avail for operations Michael Bringmann
2017-10-18 20:09 ` Michael Bringmann [this message]
2017-10-19 8:56 ` [PATCH V2 2/3] pseries/findnodes: Find nodes with memory for memoryless nodes Michael Ellerman
2017-11-15 17:38 ` Michael Bringmann
2017-10-18 20:09 ` [PATCH V2 3/3] pseries/initnodes: Ensure nodes initialized for hotplug Michael Bringmann
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=bcccffb8-8472-463d-cca5-698db5cbc8e1@linux.vnet.ibm.com \
--to=mwb@linux.vnet.ibm.com \
--cc=jallen@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=nfont@linux.vnet.ibm.com \
--cc=tlfalcon@linux.vnet.ibm.com \
--cc=tyreld@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).