From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Michael Bringmann <mbringm@us.ibm.com>
Subject: [PATCH] powerpc/topology: Update numa mask when cpu node mapping changes
Date: Wed, 10 Oct 2018 09:54:46 +0530 [thread overview]
Message-ID: <1539145486-10250-1-git-send-email-srikar@linux.vnet.ibm.com> (raw)
Commit 2ea626306810 ("powerpc/topology: Get topology for shared
processors at boot") will update the cpu node topology for shared lpars
on PowerVM.
However shared lpars on PowerVM also support VPHN and PRRN events.
On receiving a VPHN, PRRN events, cpu to node mapping might change.
Scheduler maintains sched_domains_numa_masks[], which is currently not
updated on cpu to node mapping changes. This can lead to machine
regressions and performance regressions.
Fix numa_update_cpu_topology() to update sched_domains_numa_masks[].
Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
arch/powerpc/mm/numa.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 3ea5b05ee6be..bf34384aa314 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -29,6 +29,7 @@
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
+#include <linux/sched/hotplug.h>
#include <asm/cputhreads.h>
#include <asm/sparsemem.h>
#include <asm/prom.h>
@@ -1424,6 +1425,19 @@ int numa_update_cpu_topology(bool cpus_locked)
changed = 1;
}
+ /*
+ * Scheduler maintains a sched_domain_numa_masks table that needs to
+ * be updated whenever cpu-node mapping changes. Cpu-node mapping
+ * change only with vphn and prrn.
+ */
+ if (!(topology_inited && (vphn_enabled || prrn_enabled)))
+ goto out;
+
+ for_each_cpu(cpu, &updated_cpus) {
+ sched_cpu_deactivate(cpu);
+ sched_cpu_activate(cpu);
+ }
+
out:
kfree(updates);
topology_update_needed = 0;
--
2.12.3
next reply other threads:[~2018-10-10 4:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 4:24 Srikar Dronamraju [this message]
2018-10-10 5:37 ` [PATCH] powerpc/topology: Update numa mask when cpu node mapping changes Srikar Dronamraju
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=1539145486-10250-1-git-send-email-srikar@linux.vnet.ibm.com \
--to=srikar@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mbringm@us.ibm.com \
--cc=mpe@ellerman.id.au \
/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).