[Cbe-oss-dev] [PATCH 4/3] spufs context switch - route spu interrupts to local node
Luke Browning
lukebr at linux.vnet.ibm.com
Wed Apr 23 12:02:34 EST 2008
Route spu interrupts to the local cpu node
Use specified cpu if it is on the local node.
Signed-off-by: Luke Brownign <lukebrowning at us.ibm.com>
---
Index: public_git/arch/powerpc/platforms/cell/spu_priv1_mmio.c
===================================================================
--- public_git.orig/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ public_git/arch/powerpc/platforms/cell/spu_priv1_mmio.c
@@ -75,9 +75,20 @@ static u64 int_stat_get(struct spu *spu,
static void cpu_affinity_set(struct spu *spu, int cpu)
{
- u64 target = iic_get_target_id(cpu);
- u64 route = target << 48 | target << 32 | target << 16;
+ u64 target;
+ u64 route;
+
+ if (nr_cpus_node(spu->node)) {
+ cpumask_t mask = node_to_cpumask(spu->node);
+
+ if (!cpus_intersects(mask, cpu))
+ cpu = first_cpu(mask);
+ }
+
+ target = iic_get_target_id(cpu);
+ route = target << 48 | target << 32 | target << 16;
out_be64(&spu->priv1->int_route_RW, route);
+ eieio();
}
static u64 mfc_dar_get(struct spu *spu)
Index: public_git/arch/powerpc/platforms/cell/spufs/switch.c
===================================================================
--- public_git.orig/arch/powerpc/platforms/cell/spufs/switch.c
+++ public_git/arch/powerpc/platforms/cell/spufs/switch.c
@@ -1701,11 +1701,6 @@ static inline void restore_mfc_sr1(struc
static inline void set_int_route(struct spu_state *csa, struct spu *spu)
{
- /*
- * FIX ME: this is wrong with asynchronous spu scheduling. If the
- * caller is the time slicer, all interrupts will be steered to
- * the same cpu. It also needs to be made NUMA aware.
- */
spu_cpu_affinity_set(spu, raw_smp_processor_id());
}
More information about the cbe-oss-dev
mailing list