This is a patch from John, written a few months back.  I have fixed up a few cosmetic whitespace bits, and have refreshed it so it should apply cleanly to LTP today. Will Schmidt <will_schmidt@vnet.ibm.com>.

Comments originally by John Stultz:

So I've been trying to go through and review our test cases to make sure we're getting sane data and the tests are really testing what we want. Looking at gtod_latency and gtod_infinite, I was always struck that gtod_infinite always came up with much larger latencies while gtod_latency usually seemed to miss them. Main issues:
1) gtod_latency was not running for long enough, I've upped the iterations by 10x to make sure we get more solid results.
2) gtod_latency was doing too much computation between gtod calls. This means it could miss latencies that occur while it was running. I reworked the data collection loop so the un-measured window is smaller.
3) gtod_infinite was accidentally measuring its own computation in its delay, inflating its values. I cut that logic out.
4) both gtod_latency and gtod_infinite were not running mlocked. this caused background SCHED_OTHER disk access to inject delays, making the results less reliable.

Those four issues have been fixed, and I also converted gtod_latency to use clock_gettime() just to be consistent and to give slightly better resolution.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Darren Hart <dvhltc@us.ibm.com>
Acked-by: Will Schmidt <will_schmidt@vnet.ibm.com>
2 files changed