Re: Why HZ on i386 is 100 ?

From: Herbert Xu (herbert@gondor.apana.org.au)
Date: Tue Apr 16 2002 - 21:40:58 EST


On Tue, Apr 16, 2002 at 04:56:31PM -0600, Andreas Dilger wrote:
>
> Er, because the 'tick' is a valid count of the actual time that the
> system has been running, while the "boot time" is totally meaningless.
> What if the system has no RTC, or the RTC is wrong until later in the
> boot sequence when it can be set by the user/ntpd? What if you pass
> daylight savings time? Does your uptime increase/decrease by an hour?

Tick is the number of timer interrupts that you've collected, which
may or may not be exactly 100Hz. In fact, after 400 days of operation,
the deviation from true time is likely to be above 1 hour.

Anyway, you don't need the RTC since you can always fall back to the
system clock which is no worse than before. However, if you do have
an accurate clock source then this is much better than using the tick.

If you use ntpd, then you can simply record the time on a server that
you trust, and use the tick reading at that point in time to deduce
the boot time.

-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 23 2002 - 22:00:17 EST