Re: [PATCH] hwclock: delay loop in set_hardware_clock_exact

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

 



On Fri, Aug 08, 2008 at 03:11:02AM +0300, Kalev Soikonen wrote:
> Just some thoughts.
> 
> busy looping
> 
>   Nanosleep... What guarantees does linux make in the face of clock resets?
>   A sched_yield() would busy loop but play nice with other tasks? Hmm.

 Please, don't use sched_yield(). It's the worst way how implement
 busy loop.

    "Really, I have never seen a _single_ mainstream app where the
     use of sched_yield() was the right choice." (Ingo Molnar)

 From my point of view the (half-second) busy wait is not so critical
 problem. It's more academic than a practical problem.

> writing the rtc
> 
>   There is no need to wait until [half] second. Just write it down and record
>   fractions of second in adjfile. If adjfile contains both drift and this
>   offset, the error can later be corrected.

 I don't think so. The wait before write to RTC is pretty simple. I
 think it's better to set relatively "precise" time that assume later
 correction. (Don't forget that hardware clock is not exclusively
 hwclock(8) playground (for example rtcwake(8) also read hardware
 clock, ...)).

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
--
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