Re: PROBLEM: no cpu MHz in /proc/cpuinfo on 2.6.25.4-rt6

From: Chris Friesen
Date: Wed Jun 11 2008 - 17:40:19 EST


Mark Hounschell wrote:

If they are not the same how do you know at what rate the tsc is counting.

You don't, at least not easily. The timekeeping subsystem knows, but it might be unstable, or change with cpu frequency or cpu going idle, etc.

But back to "how usable is rdtsc for time", is there a

clock_gettime(CLOCK_MONOTONIC, &time) equivalent that can be used in the kernel?

With current kernels it looks like ktime_get_ts() should give exactly the same results, since it's how that userspace function is implemented. With a stable tsc it seems like it should give full accuracy.

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