DORMANTno replies

[PATCH] spufs: don't yield nosched context

From: Jeremy Kerr <jk@ozlabs.org>
Date: 2007-06-05 01:25:59

From: Christoph Hellwig <hch@lst.de>

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

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

---

Paulus - this is also a contender for 2.6.22 bugfixes.

---

 arch/powerpc/platforms/cell/spufs/sched.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Index: linux-2.6-spufs/arch/powerpc/platforms/cell/spufs/sched.c
===================================================================
--- linux-2.6-spufs.orig/arch/powerpc/platforms/cell/spufs/sched.c
+++ linux-2.6-spufs/arch/powerpc/platforms/cell/spufs/sched.c
@@ -430,9 +430,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);
+	}
 }
 
 void spu_sched_tick(struct work_struct *work)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help