[Cbe-oss-dev] spusched: timeslicing

Arnd Bergmann arnd at arndb.de
Wed Apr 18 07:34:21 EST 2007


On Tuesday 17 April 2007, Luke Browning wrote:
> 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.  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.  There is a
> lot of code in the system that could take advantage of such a mechanism
> as most code sets timers in the range of a second or a minute and it
> doesn't matter if it goes off a little bit late. If you structured the
> code in this way it would also have the advantage of not defeating the
> idle power management code, since the cpu has to wake up to process the
> system timer.  Seems like a win all the way around.

One approach that is currently under discussion are 'deferrable timers',
see http://lwn.net/Articles/228143/. These are based on the normal
timer_list, which itself is based on a system-wide interval timer.
The newer high-resolution timer mechanism was added for waking up
at a specific time by reprogramming the system timer, but I think we
currently use the timer tick to implement that on powerpc.

In any case, the timer function will run as a bottom half with interrupts
enabled, but at interrupt time.

	Arnd <><



More information about the cbe-oss-dev mailing list