Re: [chrony-dev] PPSAPI: kernel consumer |
[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]
On Mon, 8 Feb 2010, Miroslav Lichvar wrote:
On Mon, Feb 08, 2010 at 12:35:59PM +0100, Håkan Johansson wrote:I've recently (for slightly other reasons) measured the in-kernel time consumed by doing getnstimeofday() (several in a row), and for most machines (2 GHz+) it took a whopping ~ 500 ns. I.e. one cannot know to better than 0.5 us what the time was, if one e.g. try to sandwich something else with two such calls. The best machine was actually a slower one (~1.05 GHz) that had about 60 ns between return values for two back-to-back getnstimeofday(). I suppose we are down to PCI bus latencies and so on.Which clocksource was used? The best results should provide tsc, usually few tens of nanoseconds. From some tests I did a while ago it seems to worsen with more CPU cores.
The measurements: AMD 1050 MHz, back-to-back getnstimeofday takes 62 ns Pentium M 1600 Mhz, back-to-back getnstimeofday takes 560 ns Athlon 2000 MHz, back-to-back getnstimeofday takes 560 nsAll systems single-core. Where I had available, I changed the timesource between acpi_pm and tsc with /sys/devices/system/clocksource/clocksource0/current_clocksource.
No major effect.It was however crucial in these things to do one or a few calls to getnstimeofday before the two ones to do the timing to heat the processor caches.
Cheers, Håkan
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |