Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Oct 2005 18:14:54 +0200
From:      Andre Oppermann <andre@freebsd.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, Bruce Evans <bde@zeta.org.au>
Subject:   Re: Timekeeping [Was: Re: cvs commit: src/usr.bin/vmstat vmstat.c  src/usr.bin/w w.c]
Message-ID:  <435913FE.774C683D@freebsd.org>
References:  <30805.1129910750@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> 
> In message <20051022011020.T5554@delplex.bde.org>, Bruce Evans writes:
> 
> >How do you resync laptops after suspending them for long enough for
> >the clock to drift?  Use ntpd and let it step, or use ntpd -x and let
> >it take hours to resync?  The right thing to do is step the clocks to
> >the current time immediately so that they are correct while the system
> >is actually being used.
> 
> Ahh, and now we get into interesting territory:  What _is_ the
> definition of uptime for a laptop which has been suspended ?
> 
> No matter which way you turn, there are dragons...
> 
> >> But have resigned ourselves to not caring about the actual length
> >> of seconds and therefore, presumably, having no serious interest
> >> in timekeeping quality.
> >
> >I certainly care about errors of 1 microsecond (although I don't need
> >to), and just remembered that I use stepping to fix up the clock after
> >sitting in ddb with the clock stopped.  This reduces the error in the
> >real time clock to ~1 microsecond per second stopped, but gives an error
> >of 1 second per second stopped in the monotonic time and the boot time.
> >Here the correct treatment is to jump the monotonic time forward and
> >not touch the boot time.
> 
> Again, if you have been sitting in DDB, what exactly is the definition
> of "uptime" ?

IMO it's this:

 Uptime is the time the operating was available to present it's common
 services to userland.  That excludes any suspend and ddb times.  Single
 user mode however counts because the OS was servicing userland even if
 there was only one user.  Uptime is represented in SI seconds.

 Time since boottime is the UTC delta from the time of when the OS
 initialized itself to now.  Leap seconds cause deviations from uptime.
 Time since boottime is represented as numerical delta in seconds from
 two UTC timestamps.

Uptime != Time since boottime.

-- 
Andre



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?435913FE.774C683D>