Subject: spufs: affinity now respecting numa properties From: Andre Detsch Placement of context with affinity honoring numa properties, the same way contexts without affinity already do. Signed-off-by: Andre Detsch Signed-off-by: Arnd Bergmann Index: linux-2.6/arch/powerpc/platforms/cell/spufs/sched.c =================================================================== --- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/sched.c +++ linux-2.6/arch/powerpc/platforms/cell/spufs/sched.c @@ -583,12 +583,16 @@ static struct spu * aff_ref_location(int mem_aff, int group_size, int prio, int lowest_offset) { struct spu *spu; - int node; + int node, n; /* TODO: A better algorithm could be used to find a good spu to be * used as reference location for the ctxs chain. */ - for (node = 0; node < MAX_NUMNODES; node++) { + node = cpu_to_node(raw_smp_processor_id()); + for (n = 0; n < MAX_NUMNODES; n++, node++) { + node = (node < MAX_NUMNODES) ? node : 0; + if (!node_allowed(node)) + continue; list_for_each_entry(spu, &be_spu_info[node].spus, be_list) { if ((!mem_aff || spu->has_mem_affinity) && sched_spu(spu))