diff options
author | Arnd Bergmann <arnd@arndb.de> | 2005-12-05 22:52:26 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-09 14:52:58 +1100 |
commit | 2a911f0bb73e67826062b7d073dd7367ca449724 (patch) | |
tree | c1d8d4f340cf7571722b2d9019f158acd345cff4 /arch/powerpc/platforms/cell/spufs/context.c | |
parent | 5110459f181ef1f11200bb3dec61953f08cc49e7 (diff) |
[PATCH] spufs: Improved SPU preemptability [part 2].
This patch reduces lock complexity of SPU scheduler, particularly
for involuntary preemptive switches. As a result the new code
does a better job of mapping the highest priority tasks to SPUs.
Lock complexity is reduced by using the system default workqueue
to perform involuntary saves. In this way we avoid nasty lock
ordering problems that the previous code had. A "minimum timeslice"
for SPU contexts is also introduced. The intent here is to avoid
thrashing.
While the new scheduler does a better job at prioritization it
still does nothing for fairness.
From: Mark Nutter <mnutter@us.ibm.com>
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/context.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/context.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 0d88a1c24f67..1758cec58bc7 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c @@ -116,8 +116,10 @@ int spu_acquire_runnable(struct spu_context *ctx) int ret = 0; down_read(&ctx->state_sema); - if (ctx->state == SPU_STATE_RUNNABLE) + if (ctx->state == SPU_STATE_RUNNABLE) { + ctx->spu->prio = current->prio; return 0; + } /* ctx is about to be freed, can't acquire any more */ if (!ctx->owner) { ret = -EINVAL; |