lkml.org 
[lkml]   [2004]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Uptime counter
From
Date
On Sun, 2004-02-01 at 16:07, Ludootje wrote:
> On Sun, 2004-02-01 at 20:51, Matti Aarnio wrote:
> > On Sun, Feb 01, 2004 at 10:41:41PM +0200, Markus Hästbacka wrote:
> > > Hi list,
> > > I wonder does any kernel branch have a uptime counter that doesn't stop
> > > counting at 497 days? Or is a patch needed for the job to
> > > 2.{0,2,4,6} kernel?
> >
> > Any 64 bit machine since day 1, but also 2.6 at i386 does work.
> >
> > > Markus
> >
> > /Matti Aarnio
>
> It's the first time I hear about the uptime being resetted after 497 days,
> why is this? Is this a mistake or are their reasons for it?

On 32-bit architectures, the uptime counter is only 32 bits wide. Each
"tick" of the counter is worth 1/HZ seconds (IIRC). So, you can get the
number of seconds this will hold with simple math (2^32 * 1/HZ, HZ
being 100 on i386). This is about 497.1 days.

Of course, on 64-bit architectures, the counter will hold 4 billion
times that, which is about as long as the Earth has existed. Apparently
2.6 has come up with a way to deal with this on 32-bit architectures.

Matt
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.132 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site