From: Christoph Hellwig Date: Mon, 23 Apr 2007 19:08:09 +0000 (+0200) Subject: [POWERPC] spu sched: ensure preempted threads are put back on the runqueue, part2 X-Git-Tag: upstream/snapshot3+hdmi~34947^2~72^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e097b513285e616215b23af234d127298bb8d89a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [POWERPC] spu sched: ensure preempted threads are put back on the runqueue, part2 To not lose a spu thread we need to make sure it always gets put back on the runqueue. In find_victim aswell as in the scheduler tick as done in the previous patch. Signed-off-by: Christoph Hellwig Signed-off-by: Arnd Bergmann --- diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 5149dff..405a055 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -391,6 +391,12 @@ static struct spu *find_victim(struct spu_context *ctx) } spu_unbind_context(spu, victim); mutex_unlock(&victim->state_mutex); + /* + * We need to break out of the wait loop in spu_run + * manually to ensure this context gets put on the + * runqueue again ASAP. + */ + wake_up(&victim->stop_wq); return spu; } }