From: Nishanth Aravamudan Date: Sat, 18 Oct 2014 00:50:40 +0000 (-0700) Subject: powerpc/numa: ensure per-cpu NUMA mappings are correct on topology update X-Git-Tag: v4.9.8~5441^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c0a33f9861d38631245f7ef434ecad3413324fb;p=platform%2Fkernel%2Flinux-rpi3.git powerpc/numa: ensure per-cpu NUMA mappings are correct on topology update We received a report of warning in kernel/sched/core.c where the sched group was NULL on an LPAR after a topology update. This seems to occur because after the topology update has moved the CPUs, cpu_to_node is returning the old value still, which ends up breaking the consistency of the NUMA topology in the per-cpu maps. Ensure that we update the per-cpu fields when we re-map CPUs. Signed-off-by: Nishanth Aravamudan Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index ef45abf..b9d1dfd 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -1509,11 +1509,14 @@ static int update_cpu_topology(void *data) cpu = smp_processor_id(); for (update = data; update; update = update->next) { + int new_nid = update->new_nid; if (cpu != update->cpu) continue; unmap_cpu_from_node(cpu); - map_cpu_to_node(cpu, update->new_nid); + map_cpu_to_node(cpu, new_nid); + set_cpu_numa_node(cpu, new_nid); + set_cpu_numa_mem(cpu, local_memory_node(new_nid)); vdso_getcpu_init(); }