summaryrefslogtreecommitdiff
path: root/arch/powerpc/platforms/cell/spufs/sched.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-01-05 14:05:29 +0000
committerPaul Mackerras <paulus@samba.org>2006-01-09 15:44:57 +1100
commit2fb9d2063626374dd8a2514b3a730facac8235d8 (patch)
treeb410dcdbc5aee656c37951be36951130450549e7 /arch/powerpc/platforms/cell/spufs/sched.c
parentaeb013772a2cc85a8d0baffd64977d2888bc781d (diff)
[PATCH] spufs: set irq affinity for running threads
For far, all SPU triggered interrupts always end up on the first SMT thread, which is a bad solution. This patch implements setting the affinity to the CPU that was running last when entering execution on an SPU. This should result in a significant reduction in IPI calls and better cache locality for SPE thread specific data. Signed-off-by: Arnd Bergmann <arndb@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/sched.c')
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index c34198c29159..963182fbd1aa 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -357,6 +357,11 @@ int spu_activate(struct spu_context *ctx, u64 flags)
if (!spu)
return (signal_pending(current)) ? -ERESTARTSYS : -EAGAIN;
bind_context(spu, ctx);
+ /*
+ * We're likely to wait for interrupts on the same
+ * CPU that we are now on, so send them here.
+ */
+ spu_irq_setaffinity(spu, raw_smp_processor_id());
put_active_spu(spu);
return 0;
}