[Cbe-oss-dev] [PATCH 2/2] spu sched: static timeslicing for SCHED_RR contexts

Arnd Bergmann arnd at arndb.de
Sat Feb 10 07:27:08 EST 2007


On Friday 09 February 2007 19:10, Christoph Hellwig wrote:
> For SCHED_RR tasks we can do some really trivial timeslicing.  Basically
> we fire up a time for every scheduler tick that searches for a higher
> or same priority thread that is on the runqueue and if there is one
> context switches to it.  Because we can't lock spus from timer context
> we actually run this from a delayed runqueue instead of a timer.
> 
> A nice optimization would be to skip the actual priority bitmap search
> when there are less contexts than physical spus available.  To implement
> this I need a so far unpublished patch from Andre, and it will be added
> after we have that patch in.
> 
> Note that right now we only do the time slicing for SCHED_RR tasks.
> The code would work for SCHED_OTHER tasks aswell, but their prio
> value is defered from the one the PPU thread has at time of spu_run,
> and using this for spu scheduling decisions would make the code very
> unfair.  SCHED_OTHER support will be enabled once we the spu scheduler
> knows how to calculcate cpu_context.prio (very soon)
> 
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> 
Acked-by: Arnd Bergmann <arnd.bergmann at de.ibm.com>



More information about the cbe-oss-dev mailing list