[Cbe-oss-dev] spusched: timeslicing

Christoph Hellwig hch at lst.de
Thu Apr 19 01:18:19 EST 2007


On Tue, Apr 17, 2007 at 05:09:04PM -0300, Luke Browning wrote:
> It should perform a lot better than the current approach which is a
> really good testcase for timers.

The current approach in CVS is a scheduler thread by now :)

> It should be possible to take advantage of the dynamic tick code in the
> mainline scheduler if you can provide this function as an extension of
> the system timer. The old unix routine, delay(), was based on the system
> timer.  It performed the wakeup in the context of the system timer.

In Linux we have this as schedule_timeout()/mdelay().  I use an
opencoded variant of that in the scheduler thread.  Opencoded because
rearming the timer in the time and not the scheduling thread gives
a more stable periodic timer intervall and allows for plugging in the
load averange calculation.

> Not
> sure if linux has a sleep / wakeup mechanism built on top of the system
> timer, but if it did it would solve this problem.  There are also
> variations on this theme where a timer can be scheduled that does not
> generate any extra clock interrupts. It uses the interrupt associated
> with the system timer to guarantee that an interrupt will eventually be
> scheduled.  The clock code just processes N timer entries.

That's the aproach used by normal linux timers.  In traditional Linux
it's not that optimal because the timer ticks is very frequent anyway.
But the dyntick work relaxes this a little bit.




More information about the cbe-oss-dev mailing list