Quantcast
Channel: lkml.org : Shesha Sreenivasamurthy
Viewing all articles
Browse latest Browse all 1267

Re: [RFC] Improving udelay/ndelay on platforms where that is possible

$
0
0
Linus Torvalds writes: (Summary) On modern x86, as mentioned, the TSC is stable and fairly high frequency (it isn't really the gigahertz frequency that it reports - reading it takes time, and even ignoring that, the implementation is actually not a true adder at the reported frequency, but it is generally tens of hundreds of megahertz, so you should get something that is close to the "tens of nanoseconds" resolution).
the "tens of nanoseconds" resolution).
But on others we can't even get *close* to that kind of behavior, and if the clock is something like a 32kHz timer that you mention, you obviously aren't going to get even microsecond resotulion, much less nanoseconds.
nanoseconds.
You can (and on x86 we do) calibrate a faster non-architected clock against a slow clock, but all the faster clocks tend to have that frequency shifting issue.
frequency shifting issue.
So then you tend to be forced to simply rely on platform-specific hacks if you really need something more precise.

Viewing all articles
Browse latest Browse all 1267

Trending Articles