Re: dynamic-hz
From: Pavel Machek
Date: Mon Dec 13 2004 - 14:54:20 EST
Hi!
> > But that does not matter, right? Yes, one-shot timer will not fire
> > exactly at right place, but as long as you are reading TSC and basing
> > next shot on current time, error should not accumulate.
>
> As said in the rest of the message, the error (or some other error)
> accumulates heavily today in the tick-loss compensation/adjustment
> algorithm in arch/i386/kernel/timers/timer_tsc.c, so I'm sceptical
> about
I do not see how it should accumulate. Lets have working TSC. You want
to emulate fixed-period timer with single-shot timer.
int should_fire_at;
void handle_single_shot()
{
int delay;
retry:n
should_fire_at += loops_per_second/HZ
delay = should_fire_at - get_tsc();
if (delay < 0)
goto retry;
do_single_shot_in(delay);
}
I'm not sure what's broken with compensation code, but using
single-shot timer is not broken in theory.
> > [..] for their patent abuse against Java.
>
> java isn't open source regardless of patents, use python instead ;).
Yes, java is bad, but using patents against it is evil, too. Plus
python does not yet run on my cellphone ;-).
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/