[Cbe-oss-dev] [PATCH 4/10] spu sched: consolidate SPU_STATE_RUNNABLE assignments
Christoph Hellwig
hch at lst.de
Mon Jan 8 09:15:01 EST 2007
Only bind_context/unbind_context change the spu context state. Thus
we can move all assignents of SPU_STATE_RUNNABLE into bind_context,
which parallels the unbind side aswell.
Signed-off-by: Christoph Hellwig <hch at lst.de>
Index: linux-2.6/arch/powerpc/platforms/cell/spufs/context.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/context.c 2006-12-17 21:25:37.000000000 +0100
+++ linux-2.6/arch/powerpc/platforms/cell/spufs/context.c 2006-12-17 21:25:49.000000000 +0100
@@ -135,7 +135,6 @@
ret = spu_activate(ctx, 0);
if (ret)
goto out;
- ctx->state = SPU_STATE_RUNNABLE;
} else {
/* We need to exclude userspace access to the context. */
spu_unmap_mappings(ctx);
@@ -169,7 +168,6 @@
ret = spu_activate(ctx, 0);
if (ret)
goto out;
- ctx->state = SPU_STATE_RUNNABLE;
}
downgrade_write(&ctx->state_sema);
Index: linux-2.6/arch/powerpc/platforms/cell/spufs/sched.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/sched.c 2006-12-17 21:25:09.000000000 +0100
+++ linux-2.6/arch/powerpc/platforms/cell/spufs/sched.c 2006-12-17 21:25:34.000000000 +0100
@@ -118,6 +118,8 @@
spu->timestamp = jiffies;
spu_cpu_affinity_set(spu, raw_smp_processor_id());
spu_switch_notify(spu, ctx);
+
+ ctx->state = SPU_STATE_RUNNABLE;
}
static inline void unbind_context(struct spu *spu, struct spu_context *ctx)
More information about the cbe-oss-dev
mailing list