diff options
author | Luke Browning <lukebr@linux.vnet.ibm.com> | 2007-12-20 02:39:59 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-21 03:46:20 -0500 |
commit | b192541b39ed29ff82f9f2d5427f451e89617f1c (patch) | |
tree | d96c3a4a957da334955ed96bcd2902b06268c6cd /arch | |
parent | 91569531d1297db42d68136ac0c85cd85223d0b9 (diff) |
[POWERPC] spufs: spu_find_victim may choose wrong victim
Need to re-check priority after dropping lock. Otherwise, a
more favored context may be preempted.
Signed-off-by: Luke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index ef0e5e230fbb..54b338f8363f 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -626,10 +626,10 @@ static struct spu *find_victim(struct spu_context *ctx) | |||
626 | } | 626 | } |
627 | 627 | ||
628 | spu = victim->spu; | 628 | spu = victim->spu; |
629 | if (!spu) { | 629 | if (!spu || victim->prio <= ctx->prio) { |
630 | /* | 630 | /* |
631 | * This race can happen because we've dropped | 631 | * This race can happen because we've dropped |
632 | * the active list mutex. No a problem, just | 632 | * the active list mutex. Not a problem, just |
633 | * restart the search. | 633 | * restart the search. |
634 | */ | 634 | */ |
635 | mutex_unlock(&victim->state_mutex); | 635 | mutex_unlock(&victim->state_mutex); |