Skip to content

Commit

Permalink
[POWERPC] spusched: Fix timeslice calculations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeremy Kerr authored and Paul Mackerras committed Jul 3, 2007
1 parent fe443ef commit 60e2423
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 60e2423

Please sign in to comment.