Re: [PATCH] s390 (9/9): no timer interrupts in idle.

From: Arjan van de Ven
Date: Thu Apr 22 2004 - 08:05:20 EST


On Thu, Apr 22, 2004 at 02:14:44PM +0200, Martin Schwidefsky wrote:
> > What I'm proposing as alternative is using the one shot mode of the
> timers
> > on most machines to do teh following:
> > when the timer irq hits, you do the business you need to do. And then you
> > check all existing timers and the scheduler when the next "virtual tick"
> is where
> > you're going to do real work. You then set the one-shot counter to that
> > amount. This means that in add_timer/mod_timer you will need to check if
> the
> > just added timer is before the current one-shot runs out, and if so,
> adjust
> > it. Perhaps in the scheduler too.
>
> You can't do that with the current timer code. A HZ timer interrupt is used
> for several things: 1) increase jiffies_64, 2) update the xtime, 3) calculate
> the load every 5 seconds, 4) check cpu time limits and send SIGXCPU,
> 5) do interval timer stuff, 6) run local timer queue and 7) add time slice to
> current process. With your one-shot timer you won't do the correct updates
> to the jiffies and the xtime.

xtime is easy, that's interpolated anyway afaics. Jiffies would either just
jump some, which code needs to deal with anyway given that preempt can do
the same, or would become an approximated thing as well based on the other
time keeping sources in the system.

calculating the load can be a real timer for sure (which would cause an irq
at that time), cpu limits we can do at the end of timeslice (and set the
timeslice such that the limits won't be exceeded).

Attachment: pgp00000.pgp
Description: PGP signature