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

From: Andi Kleen
Date: Wed Jul 26 2006 - 11:15:04 EST


Neil Horman <nhorman@xxxxxxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/