]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] spufs: don't (ab)use SCHED_IDLE
authorJeremy Kerr <jk@ozlabs.org>
Tue, 4 Mar 2008 09:17:02 +0000 (20:17 +1100)
committerJeremy Kerr <jk@ozlabs.org>
Tue, 11 Mar 2008 01:28:02 +0000 (12:28 +1100)
commit 4ef11014 introduced a usage of SCHED_IDLE to detect when
a context is within spu_run.

Instead of SCHED_IDLE (which has other meaning), add a flag to
sched_flags to tell if a context should be running.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
arch/powerpc/platforms/cell/spufs/run.c
arch/powerpc/platforms/cell/spufs/sched.c
arch/powerpc/platforms/cell/spufs/spufs.h

index 6221968c2a3ce24d6bc11f3a5807db3ccaff440e..cac69e116776bd6bc5e91553057b3f2e4526ac79 100644 (file)
@@ -220,6 +220,7 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
                }
        }
 
+       set_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags);
        return 0;
 }
 
@@ -234,7 +235,7 @@ static int spu_run_fini(struct spu_context *ctx, u32 *npc,
        *npc = ctx->ops->npc_read(ctx);
 
        spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED);
-       ctx->policy = SCHED_IDLE;
+       clear_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags);
        spu_release(ctx);
 
        if (signal_pending(current))
index 5d5f680cd0b8ced5789556e444a0b8b955cc23c8..00528ef84ad2085613703a8feab52a25b1ee9f93 100644 (file)
@@ -867,7 +867,7 @@ static noinline void spusched_tick(struct spu_context *ctx)
        if (ctx->policy == SCHED_FIFO)
                goto out;
 
-       if (--ctx->time_slice && ctx->policy != SCHED_IDLE)
+       if (--ctx->time_slice && test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags))
                goto out;
 
        spu = ctx->spu;
@@ -877,7 +877,7 @@ static noinline void spusched_tick(struct spu_context *ctx)
        new = grab_runnable_context(ctx->prio + 1, spu->node);
        if (new) {
                spu_unschedule(spu, ctx);
-               if (ctx->policy != SCHED_IDLE)
+               if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags))
                        spu_add_to_rq(ctx);
        } else {
                spu_context_nospu_trace(spusched_tick__newslice, ctx);
index 2c2fe3c07d72da414038e8a81d327eaa4457baf4..cdc515182f823fc71357886c7dc5205f1d97f11d 100644 (file)
@@ -44,6 +44,7 @@ struct spu_gang;
 enum {
        SPU_SCHED_NOTIFY_ACTIVE,
        SPU_SCHED_WAS_ACTIVE,   /* was active upon spu_acquire_saved()  */
+       SPU_SCHED_SPU_RUN,      /* context is within spu_run */
 };
 
 struct spu_context {