Skip to content

Commit

Permalink
[POWERPC] spufs: don't requeue victim contex in find_victim if it's n…
Browse files Browse the repository at this point in the history
…ot in spu_run

We should not requeue the victim context in find_victim if the owner is
not in spu_run. It's first not needed because leaving the context on
the spu is an optimization and second is harmful because it means the
owner could re-enter spu_run when the context is on the runqueue and
trip the BUG_ON in __spu_update_sched_info.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
  • Loading branch information
Christoph Hellwig authored and Jeremy Kerr committed May 8, 2008
1 parent 826be06 commit 7a28a15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,8 @@ static struct spu *find_victim(struct spu_context *ctx)

victim->stats.invol_ctx_switch++;
spu->stats.invol_ctx_switch++;
spu_add_to_rq(victim);
if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags))
spu_add_to_rq(victim);

mutex_unlock(&victim->state_mutex);

Expand Down

0 comments on commit 7a28a15

Please sign in to comment.