Re: Nasty suprise with uptime

Tim Walberg (twalberg@mindspring.com)
Tue, 30 Oct 2001 07:50:43 -0600


--aT9PWwzfKXlsBJM1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Wouldn't it be fairly simple for the kernel to just remember the (wall
clock) time at boot, and uptime just subtract that from the current
(wall clock) time? It would be another variable in the kernel requiring
storage but not having a whole lot of use, but what's another 8 bytes
these days? (ok, maybe it would be more critical in embedded and other
such space critical applications, but not for general desktop/server
use...)

tw

On 10/30/2001 00:53 -0800, george anzinger wrote:
>> Jonathan Briggs wrote:
>> >=20
>> > A 32 bit uptime patch should also include a new kernel parameter that
>> > could be passed from LILO: uptime. Then you could test the uptime pat=
ch
>> > by passing uptime=3D4294967295
>> >=20
>> > Or make /proc/uptime writable.
>>=09
>> NO NO NO! =20
>>=09
>> First uptime is a conversion of jiffies. Second, the POSIX standard
>> wants a CLOCK_MONOTONIC which, by definition, can not be set. Jiffies
>> is the most reasonable source for this clock. I am afraid you will have
>> to accumulate "real" time for uptime :)
>>=09
>> George
>>=09
>>=09
>> >=20
>> > David Relson wrote:
>> >=20
>> > > Let's assume you have the counter changed to 32 bits - RIGHT NOW
>> > > (tm). Build a kernel, install it, reboot. It'll be over a year
>> > > (approx Jan 2003) before the change will be noticeable...
>> > >
>> > > Methinks that's a long time to wait for a result :-)
>> > >
>> > > David
>> > >
>> >=20
>> > -
>> > 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/
>> -
>> 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/
End of included message

--=20
twalberg@mindspring.com

--aT9PWwzfKXlsBJM1
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.1i

iQA/AwUBO96wMcPlnI9tqyVmEQJ0sgCgmpkx2msBsdMriCwNIYUHeqgWA/wAniUD
X2D80HBCYhSh565tZZx6Ygta
=dz+v
-----END PGP SIGNATURE-----

--aT9PWwzfKXlsBJM1--
-
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/