]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] spusched: Fix timeslice calculations
authorJeremy Kerr <jk@ozlabs.org>
Fri, 29 Jun 2007 00:57:53 +0000 (10:57 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 3 Jul 2007 05:24:44 +0000 (15:24 +1000)
The current timeslice code mixes 'jiffies' up with 'spesched ticks'. This
change correctly defines the number of time slices each SPE contexts is
given, and clarifies the comment.

This brings the default timeslice for SPE contexts into a reasonable
range.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/spufs/sched.c

index 1b2916bdc1c8fde2fd3d634a18b5e5ebef43377f..6843a01b1a2584152b774bd3077e716f313ba6d2 100644 (file)
@@ -70,11 +70,11 @@ static struct timer_list spusched_timer;
 /*
  * These are the 'tuning knobs' of the scheduler:
  *
- * Minimum timeslice is 5 msecs (or 10 jiffies, whichever is larger),
- * default timeslice is 100 msecs, maximum timeslice is 800 msecs.
+ * Minimum timeslice is 5 msecs (or 1 spu scheduler tick, whichever is
+ * larger), default timeslice is 100 msecs, maximum timeslice is 800 msecs.
  */
-#define MIN_SPU_TIMESLICE      max(5 * HZ / 100, 10)
-#define DEF_SPU_TIMESLICE      (100 * HZ / 100)
+#define MIN_SPU_TIMESLICE      max(5 * HZ / (1000 * SPUSCHED_TICK), 1)
+#define DEF_SPU_TIMESLICE      (100 * HZ / (1000 * SPUSCHED_TICK))
 
 #define MAX_USER_PRIO          (MAX_PRIO - MAX_RT_PRIO)
 #define SCALE_PRIO(x, prio) \