Re: [PATCH] RTC: Add mmap method to rtc character driver

Andi Kleen
2006-07-26T15:17:11Z

Neil Horman <nhorman@tuxdriver.com> writes:

> At OLS last week, During Dave Jones Userspace Sucks presentation, Jim
> Geddys and some of the Xorg guys noted that they would be able to stop using gettimeofday
> so frequently, if they had some other way to get a millisecond resolution timer
> in userspace,

No, no, it's wrong. They should use gettimeofday and the kernel's job
is to make it fast enough that they can.

Or rather they likely shouldn't use gettimeofday, but clock_gettime()
with CLOCK_MONOTONIC instead to be independent of someone setting the
clock back.

Memory mapped counters are generally not flexible enough and there
are lots of reasons why the kernel might need to do special things
for time keeping. Don't expose them.

-Andi