[Cbe-oss-dev] [PATCH] spusched: ix variable length timeslice calculation

Jeremy Kerr jk at ozlabs.org
Fri Jun 15 20:06:01 EST 2007


On Wednesday 30 May 2007, Luke Browning wrote:

> I believe HZ is 250 by default.
>
> For nice -20 SPE contexts, the time slice is eight seconds.
>
> 	max(1000 * 40 / 20, 12) = 2000 ticks x 4 mseconds = 8 seconds

Hm. At the moment (ie, without your fix), the "normal" 
(DEF_SPU_TIMESLICE) timeslice is 250, at HZ=250. That's 250 
spesched-ticks, not jiffies (maybe the comment above should be changed 
to clarify that we're dealing with spesched ticks here?).

So, at HZ=250 (4ms per jiffy), a spesched tick is 40ms, 250 of those 
ticks per timeslice gives us 40 * 250 = 10000ms = 10 seconds for a 
default timeslice.

This makes my SPE scheduler benchmark - lots of SPE contexts blocked on 
a rdch instruction - really suck :(

With this patch, we get the default time slices down to 1 second, which 
improves things, but still seems like a while. My benchmark is really a 
worst-case scenario though, hopefully most SPE applications do more 
than wait on incoming mailbox messages :)

Cheers,


Jeremy



More information about the cbe-oss-dev mailing list