[Cbe-oss-dev] [PATCH 2/3] spufs: don't yield nosched context

Christoph Hellwig hch at lst.de
Mon Jun 4 20:09:33 EST 2007


Nosched context sould never be scheduled out, thus we must not
deactivate them in spu_yield ever.


Signed-off-by: Christoph Hellwig <hch at lst.de>

Index: linux-cell/arch/powerpc/platforms/cell/spufs/sched.c
===================================================================
--- linux-cell.orig/arch/powerpc/platforms/cell/spufs/sched.c	2007-06-04 10:09:20.000000000 +0200
+++ linux-cell/arch/powerpc/platforms/cell/spufs/sched.c	2007-06-04 10:09:48.000000000 +0200
@@ -702,9 +702,11 @@ void spu_deactivate(struct spu_context *
  */
 void spu_yield(struct spu_context *ctx)
 {
-	mutex_lock(&ctx->state_mutex);
-	__spu_deactivate(ctx, 0, MAX_PRIO);
-	mutex_unlock(&ctx->state_mutex);
+	if (!(ctx->flags & SPU_CREATE_NOSCHED)) {
+		mutex_lock(&ctx->state_mutex);
+		__spu_deactivate(ctx, 0, MAX_PRIO);
+		mutex_unlock(&ctx->state_mutex);
+	}
 }
 
 static void spusched_tick(struct spu_context *ctx)



More information about the cbe-oss-dev mailing list