[Cbe-oss-dev] [PATCH 06/11] powerpc/spufs: Time slice lazily loaded contexts.
Andre Detsch
adetsch at br.ibm.com
Fri Sep 12 09:38:14 EST 2008
All SPUs are stopped. All contexts are either executing library
code or they have major faulted in spu_run.
Signed-off-by: Luke Browning <lukebrowning at us.ibm.com>
Signed-off-by: Andre Detsch <adetsch at br.ibm.com>
---
arch/powerpc/platforms/cell/spufs/sched.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c
b/arch/powerpc/platforms/cell/spufs/sched.c
index c0cc876..f3dee8d 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -1230,9 +1230,13 @@ static noinline int spusched_tick(struct spu_gang
*gang,
goto out;
/*
- * If nrunnable is zero, then all of the contexts are in user mode.
+ * If nrunnable is zero, then all of the contexts are in user mode
+ * and by definition nfaulting is equal to zero. Otherwise if they
+ * are equal, all of the contexts in spu_run have faulted. In both
+ * cases, all spus are stopped and we should yield assuming there
+ * is another gang on the runqueue.
*/
- yield = !atomic_read(&gang->nrunnable);
+ yield = atomic_read(&gang->nrunnable) == atomic_read(&gang->nfaulting);
if (yield || ((ctx->policy != SCHED_FIFO) && (!--ctx->time_slice))) {
if (spu_prio->nr_waiting) {
--
1.5.4.1
More information about the cbe-oss-dev
mailing list