Skip to contentSkip to conversation

powerpc/numa: use cached value of update->cpu in update_cpu_topology

PATCH In review Nishanth Aravamudan 2 participants 4 messages Oct 18, 2014 – Oct 28, 2014 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 powerpc/numa: use cached value of update->cpu in update_cpu_topology

There isn't any need to keep referring to update->cpu, as we've already checked cpu == update->cpu at this point.

arch/powerpc/mm/numa.c +2 -2
index 649666d5d1c2..86fdb004ad2f 100644
@@ -1491,8 +1491,8 @@ static int update_cpu_topology(void *data)
 		if (cpu != update->cpu)
 			continue;
 
-		unmap_cpu_from_node(update->cpu);
-		map_cpu_to_node(update->cpu, update->new_nid);
+		unmap_cpu_from_node(cpu);
+		map_cpu_to_node(cpu, update->new_nid);
 		vdso_getcpu_init();
 	}
 
#1 lore raw

PATCH 2/2 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.

arch/powerpc/mm/numa.c +4 -1
index 86fdb004ad2f..048be62dc979 100644
@@ -1488,11 +1488,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();
 	}
 
#2 lore raw

Re: [2/2] powerpc/numa: ensure per-cpu NUMA mappings are correct on topology update

Quoted 6 lines · Nishanth Aravamudan

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.

This looks like a bug fix, I assume you want it to go in for 3.18 ?

cheers

#3 lore raw

Re: [2/2] powerpc/numa: ensure per-cpu NUMA mappings are correct on topology update

Hi Michael,

Quoted 9 lines · Michael Ellerman
Quoted 6 lines · Nishanth Aravamudan

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.

This looks like a bug fix, I assume you want it to go in for 3.18 ?

Yes, please!

Thanks,
Nish