r/linux•
Pas__

How does the kernel deal with a non-constant TSC (Time Stamp Counter)?

Newer CPUs have sort-of reliable devices for accurate timekeeping (see), but, as far as I know, CLOCK_MONOTONIC is available on systems without these nice guarantees.

So, what's the solution? It has simply worse resolution and then the kernel just uses the RTC? Or is there some clever mechanism that allows it to figure out how much time was spent in which power state and how much slower the clock was ticking in those intervals? (I doubt that, after all clock gating and frequency domains are very transparent to the software on top.) Or maybe the kernel just keeps polling the CPU? (Which would be very inefficient and wouldn't provide much resolution either.)

Thanks for any input!

Posted Aug 19, 2013, 6:16 PM UTC

06
Loading comments…