Re: Why HZ on i386 is 100 ?

Alan Cox
2002-04-27T20:09:33Z

> > I remain unconvinced. Firstly the timer changes do not have to
> > occur at schedule rate unless your implementaiton is incredibly naiive.
>
> OK, I'll bite, how do you stop a task at the end of its slice if you
> don't set up a timer event for that time?

At high scheduling rate you task switch more often than you hit the timer,
so you want to handle it in a lazy manner most of the time. Ie so long as
the timer goes off before the time slice expire why frob it

> > Secondly for the specfic schedule case done that way, it would be even more
> > naiive to use the standard timer api over a single compare to getthe
> > timer list versus schedule clock.
>
> I guess it is my day to be naive :) What are you suggesting here?

At the point you think about setting the timer register you do

next_clock = first_of(timers->head, next_timeslice);
if(before(next_clock, current_clock)
{
current_clock = next_clock;
set_timeout(next_clock);
}