aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/context.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-04-23 15:08:11 -0400
committerArnd Bergmann <arnd@klappe.arndb.de>2007-04-23 15:18:54 -0400
commita475c2f43520cb095452201da57395000cfeb94c (patch)
tree0cfe49111b15cf20b03d308ec8b5a8b5210b0363 /arch/powerpc/platforms/cell/spufs/context.c
parent390c53430498c9973e015432806edd53b2efe6c6 (diff)
[POWERPC] spufs: remove woken threads from the runqueue early
A single context should only be woken once, and we should not have more wakeups for a given priority than the number of contexts on that runqueue position. Also add some asserts to trap future problems in this area more easily. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/context.c')
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index b3954aba424..065147fb1cc 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -52,6 +52,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
52 ctx->state = SPU_STATE_SAVED; 52 ctx->state = SPU_STATE_SAVED;
53 ctx->ops = &spu_backing_ops; 53 ctx->ops = &spu_backing_ops;
54 ctx->owner = get_task_mm(current); 54 ctx->owner = get_task_mm(current);
55 INIT_LIST_HEAD(&ctx->rq);
55 if (gang) 56 if (gang)
56 spu_gang_add_ctx(gang, ctx); 57 spu_gang_add_ctx(gang, ctx);
57 ctx->rt_priority = current->rt_priority; 58 ctx->rt_priority = current->rt_priority;
@@ -76,6 +77,7 @@ void destroy_spu_context(struct kref *kref)
76 spu_fini_csa(&ctx->csa); 77 spu_fini_csa(&ctx->csa);
77 if (ctx->gang) 78 if (ctx->gang)
78 spu_gang_remove_ctx(ctx->gang, ctx); 79 spu_gang_remove_ctx(ctx->gang, ctx);
80 BUG_ON(!list_empty(&ctx->rq));
79 kfree(ctx); 81 kfree(ctx);
80} 82}
81 83