Re: [PATCH 0/2] Add test to validate udelay
From: John Stultz
Date: Tue May 06 2014 - 20:25:39 EST
On 05/06/2014 05:12 PM, David Riley wrote:
> This change adds a module and a script that makes use of it to
> validate that udelay delays for at least as long as requested
> (as compared to ktime).
Interesting.
So fundamentally, udelay is a good bit fuzzier accuracy wise then
ktime_get(), as it may be backed by relatively coarsely calibrated delay
loops, or very rough tsc freq estimates.
ktime_get on the other hand is as fine grained as we can be, and is ntp
corrected, so that a second can really be a second.
So your comparing the fast and loose interface so we can delay a bit
before hitting some hardware again with a fairly precise interface.
Thus I'd not be surprised if your test failed on various hardware. I'd
really only trust udelay to be roughly accurate, so you might want to
consider adding some degree of acceptable error to the test.
Really, I'm curious about the backstory that made you generate the test?
I assume something bit you where udelay was way off? Or were you using
udelay for some sort of accuracy sensitive use?
thanks
-john
--
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/