Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3e76cc3244ac139fc75750c5af9edbb9f191a10
Commit:     b3e76cc3244ac139fc75750c5af9edbb9f191a10
Parent:     43c2bbd932b66403688f3d812065d82f8fb8f4b3
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 23 21:08:08 2007 +0200
Committer:  Arnd Bergmann <[EMAIL PROTECTED]>
CommitDate: Mon Apr 23 21:18:53 2007 +0200

    [POWERPC] spu sched: ensure preempted threads are put back on the runqueue
    
    To not lose a spu thread we need to make sure it always gets put back
    on the runqueue.
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Acked-by: Jeremy Kerr <[EMAIL PROTECTED]>
    Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/spufs/sched.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/sched.c 
b/arch/powerpc/platforms/cell/spufs/sched.c
index 003e330..5149dff 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -97,7 +97,7 @@ void spu_sched_tick(struct work_struct *work)
        struct spu_context *ctx =
                container_of(work, struct spu_context, sched_work.work);
        struct spu *spu;
-       int rearm = 1;
+       int preempted = 0;
 
        /*
         * If this context is being stopped avoid rescheduling from the
@@ -113,12 +113,19 @@ void spu_sched_tick(struct work_struct *work)
                int best = sched_find_first_bit(spu_prio->bitmap);
                if (best <= ctx->prio) {
                        spu_deactivate(ctx);
-                       rearm = 0;
+                       preempted = 1;
                }
        }
        mutex_unlock(&ctx->state_mutex);
 
-       if (rearm)
+       if (preempted) {
+               /*
+                * 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(&ctx->stop_wq);
+       } else
                spu_start_tick(ctx);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to