From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Bharata B Rao <redacted>
Cc: Christophe Jaillet <redacted>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nikunj A Dadhania <redacted>
Cc: Paul Mackerras <redacted>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Raghavendra K T <redacted>
Cc: Thomas Gleixner <redacted>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
arch/powerpc/mm/numa.c | 46 ++++++++++++++++------------------------------
include/linux/cpuhotplug.h | 1 +
2 files changed, 17 insertions(+), 30 deletions(-)
@@ -581,30 +581,22 @@ static void verify_cpu_node_mapping(int cpu, int node)}}-staticintcpu_numa_callback(structnotifier_block*nfb,unsignedlongaction,-void*hcpu)+/* Must run before sched domains notifier. */+staticintppc_numa_cpu_prepare(unsignedintcpu){-unsignedlonglcpu=(unsignedlong)hcpu;-intret=NOTIFY_DONE,nid;+intnid;-switch(action){-caseCPU_UP_PREPARE:-caseCPU_UP_PREPARE_FROZEN:-nid=numa_setup_cpu(lcpu);-verify_cpu_node_mapping((int)lcpu,nid);-ret=NOTIFY_OK;-break;+nid=numa_setup_cpu(cpu);+verify_cpu_node_mapping(cpu,nid);+return0;+}++staticintppc_numa_cpu_dead(unsignedintcpu)+{#ifdef CONFIG_HOTPLUG_CPU-caseCPU_DEAD:-caseCPU_DEAD_FROZEN:-caseCPU_UP_CANCELED:-caseCPU_UP_CANCELED_FROZEN:-unmap_cpu_from_node(lcpu);-ret=NOTIFY_OK;-break;+unmap_cpu_from_node(cpu);#endif-}-returnret;+return0;}/*
@@ -913,11 +905,6 @@ static void __init dump_numa_memory_topology(void)}}-staticstructnotifier_blockppc64_numa_nb={-.notifier_call=cpu_numa_callback,-.priority=1/* Must run before sched domains notifier. */-};-/* Initialize NODE_DATA for a node on the local memory */staticvoid__initsetup_node_data(intnid,u64start_pfn,u64end_pfn){
From: Anton Blanchard <hidden> Date: 2016-07-14 21:43:50
Hi,
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
@@ -985,15 +972,14 @@ void __init initmem_init(void) setup_node_to_cpumask_map(); reset_numa_cpu_lookup_table();- register_cpu_notifier(&ppc64_numa_nb);+ /* * We need the numa_cpu_lookup_table to be accurate for all
CPUs,
* even before we online them, so that we can use
cpu_to_{node,mem}
* early in boot, cf. smp_prepare_cpus().
*/
- for_each_present_cpu(cpu) {
- numa_setup_cpu((unsigned long)cpu);
- }
+ cpuhp_setup_state(CPUHP_POWER_NUMA_PREPARE,
"POWER_NUMA_PREPARE",
+ ppc_numa_cpu_prepare, ppc_numa_cpu_dead);
}
static int __init early_numa(char *p)
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
This is causing an oops on ppc64le QEMU, looks like a NULL pointer:
Did you tested it against tip WIP.hotplug?
Regards,
Anna-Maria
From: Anton Blanchard <hidden> Date: 2016-07-15 00:28:50
Hi Anna-Maria,
quoted
quoted
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
This is causing an oops on ppc64le QEMU, looks like a NULL
pointer:
Did you tested it against tip WIP.hotplug?
I noticed tip started failing in my CI environment which tests on QEMU.
The failure bisected to commit 425209e0abaf2c6e3a90ce4fedb935c10652bf80
It reproduces running ppc64le QEMU on a x86-64 box. On Ubuntu:
sudo apt-get install qemu-system-ppc gcc-powerpc64le-linux-gnu
make ARCH=powerpc pseries_le_defconfig
make ARCH=powerpc CROSS_COMPILE=powerpc64le-linux-gnu- vmlinux -j4
qemu-system-ppc64 -nographic -vga none -kernel vmlinux
Anton
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
This is causing an oops on ppc64le QEMU, looks like a NULL
pointer:
Did you tested it against tip WIP.hotplug?
I noticed tip started failing in my CI environment which tests on QEMU.
The failure bisected to commit 425209e0abaf2c6e3a90ce4fedb935c10652bf80
That's very useful, thanks Anton!
I have removed this commit from the series for the time being, refactored the
followup commits (there was one trivial conflict). We can re-try this patch when a
fix is found.
Thanks,
Ingo
From: Anton Blanchard <hidden> Date: 2016-07-15 12:14:56
quoted
I noticed tip started failing in my CI environment which tests on
QEMU. The failure bisected to commit
425209e0abaf2c6e3a90ce4fedb935c10652bf80
That's very useful, thanks Anton!
I have removed this commit from the series for the time being,
refactored the followup commits (there was one trivial conflict). We
can re-try this patch when a fix is found.
Thanks Ingo, my tests are passing again after your last push.
Anton
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: 2016-07-15 16:20:57
* Anton Blanchard | 2016-07-15 10:28:25 [+1000]:
Hi Anna-Maria,
Hi Anton,
quoted
quoted
quoted
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs. =20
This is causing an oops on ppc64le QEMU, looks like a NULL
pointer: =20
=20
Did you tested it against tip WIP.hotplug?
I noticed tip started failing in my CI environment which tests on QEMU.
The failure bisected to commit 425209e0abaf2c6e3a90ce4fedb935c10652bf80
It reproduces running ppc64le QEMU on a x86-64 box. On Ubuntu:
=E2=80=A6
Thanks for that. I can reproduce this ontop of latest WIP.hotplug with
this patch.
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: 2016-07-18 14:08:10
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.
v1=E2=80=A6v2: manual callback invocation on boot-CPU (cpuhp is not up yet =
and
we need them all before additional CPUs are up).
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Bharata B Rao <redacted>
Cc: Christophe Jaillet <redacted>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nikunj A Dadhania <redacted>
Cc: Paul Mackerras <redacted>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Raghavendra K T <redacted>
Cc: Thomas Gleixner <redacted>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
---
arch/powerpc/mm/numa.c | 48 ++++++++++++++++++------------------------=
----
include/linux/cpuhotplug.h | 1 +
2 files changed, 20 insertions(+), 29 deletions(-)
=20
reset_numa_cpu_lookup_table();
- register_cpu_notifier(&ppc64_numa_nb);
+
/*
* We need the numa_cpu_lookup_table to be accurate for all CPUs,
* even before we online them, so that we can use cpu_to_{node,mem}
* early in boot, cf. smp_prepare_cpus().
+ * _nocalls() + manual invocation is used because cpuhp is not yet
+ * initialized for the boot CPU.
*/
- for_each_present_cpu(cpu) {
- numa_setup_cpu((unsigned long)cpu);
- }
+ cpuhp_setup_state_nocalls(CPUHP_POWER_NUMA_PREPARE, "POWER_NUMA_PREPARE",
+ ppc_numa_cpu_prepare, ppc_numa_cpu_dead);
+ for_each_present_cpu(cpu)
+ numa_setup_cpu(cpu);
}
=20
static int __init early_numa(char *p)