Messages in this thread | | | From | Peter Chubb <> | Date | Fri, 31 Oct 2003 10:15:05 +1100 | Subject | Re: gettimeofday resolution seriously degraded in test9 |
| |
>>>>> "Richard" == Richard B Johnson <root@chaos.analogic.com> writes:
Richard> There isn't any magic that can solve this problem. It turns Richard> out that with later Intel CPUs, one can get CPU-clock Richard> resolution from rdtsc. However, this is hardware-specific. If Richard> somebody modifies the gettimeofday() and the POSIX clock Richard> routines to use rdtsc when available, a lot of problems will Richard> go away.
gettimofday() and the posix clock routines (which use gettimeofday()) *do* use rdtsc if the processor has a reliable one --- do_gettimeofday() calls cur_timer->get_offset(), which is essentially a scaled rdtsc if you're using timers_tsc.c.
But when you have power management turned on, TSC doesn't run at a constant rate. If it gets *too* slow, the timer switches to use the PIT instead, and one loses the cycle-resolution one would otherwise have.
-- Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au You are lost in a maze of BitKeeper repositories, all slightly different.
- 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/
| |