From: Michael Bringmann <mwb@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org
Cc: Rob Herring <robh@kernel.org>,
Mike Rapoport <rppt@linux.vnet.ibm.com>,
tlfalcon@linux.vnet.ibm.com,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
Vaidyanathan Srinivasan <svaidyan@in.ibm.com>,
mwb@linux.vnet.ibm.com, minkim@us.ibm.com,
Paul Mackerras <paulus@samba.org>,
tyreld@linux.vnet.ibm.com,
Andrew Morton <akpm@linux-foundation.org>,
Guenter Roeck <linux@roeck-us.net>,
Corentin Labbe <clabbe@baylibre.com>
Subject: [RFC 1/3] powerpc/numa: Conditionally online new nodes
Date: Tue, 11 Dec 2018 16:03:45 -0600 [thread overview]
Message-ID: <20181211220336.87502.24778.stgit@powerkvm6.aus.stglabs.ibm.com> (raw)
In-Reply-To: <20181211220321.87502.72082.stgit@powerkvm6.aus.stglabs.ibm.com>
Add argument to allow caller to determine whether the node identified
for a cpu after an associativity / affinity change should be inited.
Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/topology.h | 2 +-
arch/powerpc/mm/numa.c | 6 +++---
arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index a4a718d..4621f40 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -90,7 +90,7 @@ static inline void update_numa_cpu_lookup_table(unsigned int cpu, int node) {}
extern int start_topology_update(void);
extern int stop_topology_update(void);
extern int prrn_is_enabled(void);
-extern int find_and_online_cpu_nid(int cpu);
+extern int find_and_online_cpu_nid(int cpu, bool must_online);
extern int timed_topology_update(int nsecs);
extern void __init shared_proc_topology_init(void);
#else
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 87f0dd0..7d6bba264 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1197,7 +1197,7 @@ static long vphn_get_associativity(unsigned long cpu,
return rc;
}
-int find_and_online_cpu_nid(int cpu)
+int find_and_online_cpu_nid(int cpu, bool must_online)
{
__be32 associativity[VPHN_ASSOC_BUFSIZE] = {0};
int new_nid;
@@ -1210,7 +1210,7 @@ int find_and_online_cpu_nid(int cpu)
if (new_nid < 0 || !node_possible(new_nid))
new_nid = first_online_node;
- if (NODE_DATA(new_nid) == NULL) {
+ if (must_online && (NODE_DATA(new_nid) == NULL)) {
#ifdef CONFIG_MEMORY_HOTPLUG
/*
* Need to ensure that NODE_DATA is initialized for a node from
@@ -1337,7 +1337,7 @@ int numa_update_cpu_topology(bool cpus_locked)
continue;
}
- new_nid = find_and_online_cpu_nid(cpu);
+ new_nid = find_and_online_cpu_nid(cpu, true);
if (new_nid == numa_cpu_lookup_table[cpu]) {
cpumask_andnot(&cpu_associativity_changes_mask,
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 2f8e621..620cb57 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -366,7 +366,7 @@ static int dlpar_online_cpu(struct device_node *dn)
!= CPU_STATE_OFFLINE);
cpu_maps_update_done();
timed_topology_update(1);
- find_and_online_cpu_nid(cpu);
+ find_and_online_cpu_nid(cpu, true);
rc = device_online(get_cpu_device(cpu));
if (rc)
goto out;
next prev parent reply other threads:[~2018-12-11 22:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 22:03 [RFC 0/3] powerpc/pseries: Remap hw to kernel cpu indexes Michael Bringmann
2018-12-11 22:03 ` Michael Bringmann [this message]
2018-12-11 22:03 ` [RFC 2/3] powerpc/numa: Define mapping between HW and kernel cpus Michael Bringmann
2018-12-11 22:04 ` [RFC 3/3] powerpc/numa: Apply " 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=20181211220336.87502.24778.stgit@powerkvm6.aus.stglabs.ibm.com \
--to=mwb@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=clabbe@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=minkim@us.ibm.com \
--cc=npiggin@gmail.com \
--cc=paulus@samba.org \
--cc=robh@kernel.org \
--cc=rppt@linux.vnet.ibm.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=svaidyan@in.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).