[PATCH] spufs: Improved SPU preemptability [part 2].

This patch reduces lock complexity of SPU scheduler, particularly
for involuntary preemptive switches.  As a result the new code
does a better job of mapping the highest priority tasks to SPUs.

Lock complexity is reduced by using the system default workqueue
to perform involuntary saves.  In this way we avoid nasty lock
ordering problems that the previous code had.  A "minimum timeslice"
for SPU contexts is also introduced.  The intent here is to avoid
thrashing.

While the new scheduler does a better job at prioritization it
still does nothing for fairness.

From: Mark Nutter <mnutter@us.ibm.com>
Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 20f4e51..5bb75f2 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -37,6 +37,9 @@
 
 struct spu_context_ops;
 
+#define SPU_CONTEXT_PREEMPT_nr          0UL
+#define SPU_CONTEXT_PREEMPT             (1UL << SPU_CONTEXT_PREEMPT_nr)
+
 struct spu_context {
 	struct spu *spu;		  /* pointer to a physical SPU */
 	struct spu_state csa;		  /* SPU context save area. */
@@ -55,6 +58,8 @@
 	struct fasync_struct *ibox_fasync;
 	struct fasync_struct *wbox_fasync;
 	struct spu_context_ops *ops;
+	struct work_struct reap_work;
+	u64 flags;
 };
 
 /* SPU context query/set operations. */