LinuxSA Mailing list archives
Index:
[thread]
[date]
[subject]
[author]
[stats]
From: Alan Kennington <ak.linuxsa@topology.org>
To : LinuxSA <linuxsa@linuxsa.org.au>
Date: Sun, 20 Apr 2003 16:21:05 +0930
Re: uptime = 1 day, Grrrrr....
On Sun, Apr 20, 2003 at 03:35:19PM +1000, Robert Thorsby wrote:
> On 2003.04.20 15:21 Alan Kennington wrote:
[...]
> > Who's bright idea was it to make it impossible to boast a 500+ day
> > uptime?
>
> I think you will find that after 497 days the kernel counter runs out
> of digits so it starts all over again -- just like the odometer of your
> car.
>
> Even worse, when playing around with the 2.5 kernel the counter was
> accelerated by an order of magnitude, so it recycles after 49.7 days.
Just checking this in "bc", I got this:
2^32 / (100*60*60*24)
497.1026962962
Obviously it's the "jiffies" variable that's being reported in "uptime".
I guess this just rubs in the well-known point that device driver and
kernel writers who rely on "jiffies" to measure time are taking a risk
over periods of more than 497 days.
So maybe... there could be some lurking bugs in the kernel which surface
after 497 days, like if someone compares two jiffies values to work
out which even occurred first.
So it might not be such a bad idea to reboot after 497 days after all.
Since "gettimeofday", or the kernel equivalent do_gettimeofday,
runs correctly until 2038 some time, you would have thought that the
user-level "uptime" command would have some way of subtracting
current time from the epoch of the last boot.
Does anyone just happen to know of a convenient way of finding out,
within the kernel, what the last boot time was?
Or is "jiffies" the closest approximation to a "time since boot"
parameter within the kernel?
Cheers,
Alan Kennington.
PS. It's now just 34 years and 9 months to Unix doomsday:
http://www.merlyn.demon.co.uk/critdate.htm#UNIX
Hmmm. And the year after that, we get hit by asteroid 2003 EP4 maybe:
http://neo.jpl.nasa.gov/risk/2003ep4.html
--
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.freenode.net
To unsubscribe from the LinuxSA list:
mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject
Index:
[thread]
[date]
[subject]
[author]
[stats]
Return to the LinuxSA Mailing List Information Page