Re: [PATCH] hwclock: delay loop in set_hardware_clock_exact

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Kalev,

 On Monday, July 28, 2008 at 2:26:44 +0300, Kalev Soikonen wrote:

> - Avoid delaying 1.5 seconds when 0.5 will do.

No more wasted wallclock time, excellent! There are three little
problems though:

 -1) debug printf()s that it waits for the next full second, instead of
the next odd half second.

 -2) The loop is 100% busy all of the time. It should better begin
sleeping, and then busywait only the last 22 ms. That's lighter on the
processor, and has an unexpected very positive effect: hwclock's
accuracy is less perturbated on a loaded system. Just like if the
scheduler was kind to us because we didn't waste timeslices by tens.

 -3) The delay loop exits at the good moment exactly, down to the single
microsecond. That's fine. But then, instead of calling RTC_SET_TIME
immediatly, the code calls various functions and subfunctions,
calculates this and that, manipulates tm structs, does debug printf()s,
writes /var/lib/lastdate file, and opens /dev/rtc. When RTC_SET_TIME is
finally called, it's too late by 110 µs in normal mode, upto 500 µs in
--debug mode.


Alain.
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux