[ntp:questions] Leap seconds

David L. Mills mills at udel.edu
Tue Jan 25 02:47:58 UTC 2005


David,

Once upon a time (NTPv3) the slew loop was separate from the feedback 
loop and that proved a very bad idea. The slew loop was removed and the 
feedback loop modified so the step threshold could be tinkered 
arbitrarily large. The -x option simply tinkers the threshold to 600 
seconds. As I said in my previous message, the kernel implementations 
that live here do not actually set the clock backwards if the adjustment 
is less than two seconds.

Dave

David Woolley wrote:

> In article <mailman.2.1106581055.88045.questions at lists.ntp.isc.org>,
> Alain <alainm at pobox.com> wrote:
> 
> 
>>It looks like the "safest way on critical systems" and "I don care much 
>>but want to be on the safe side" would be not to step and just skew that 
>>extra/missing second. Would the "-x" option do that?
> 
> 
> This is the opposite of the official advice which is not to override
> the step recovery.  In normal operation, if a step is necessary, NTP
> is too far out of lock to safely continue and the best thing is to
> staigthen things out as quickly as possible and then try and continue
> sensibly.
> 
> As far as I know, -x is no longer supported, and may never have worked.
> The tinker way of doing this has, I believe, side effects, like disabling
> the kernel time discipline code (which, see below, may a particularly
> bad thing to do with respect to leap seconds).
> 
> If you have a system that requires accurate time across a leap second,
> you should use a kernel that understands leap seconds and an ntpd 
> system dependent module that understands that kernel.  You shouldn't
> of course, use time of day differences for accurate durations.
> 
> It looks like the kernel time discipline interface passes leap seconds
> to the kernel, so hopefully, a kernel with kernel NTP support will
> not lose sync, even if it duplicates the midnight second.  The Linux
> kernel, at least for 2.4.5, appears to honour these indictions:
> 
> Linux Kernel 2.4.5 - note that 23:59:59 is repeated:
>     case TIME_INS:
>         if (xtime.tv_sec % 86400 == 0) {
>             xtime.tv_sec--;
>             time_state = TIME_OOP;
>             printk(KERN_NOTICE "Clock: inserting leap second 23:59:60 UTC\n");
>         }
>         break;
> 
>     case TIME_DEL:
>         if ((xtime.tv_sec + 1) % 86400 == 0) {
>             xtime.tv_sec++;
>             time_state = TIME_WAIT;
>             printk(KERN_NOTICE "Clock: deleting leap second 23:59:59 UTC\n");
>         }
>         break;
> 
> ntpd 4.2.0:
> 
>                          * Set the leap bits in the status word.
>                          */
>                         if (sys_leap == LEAP_NOTINSYNC) {
>                                 ntv.status |= STA_UNSYNC;
>                         } else if (calleapwhen(sys_reftime.l_ui) <
>                                     CLOCK_DAY) {
>                                 if (sys_leap & LEAP_ADDSECOND)
>                                         ntv.status |= STA_INS;
>                                 else if (sys_leap & LEAP_DELSECOND)
>                                         ntv.status |= STA_DEL;
>                         }
> 
> 
> 
>>X-Accept-Language: pt-br, pt
> 
> 
> Sorry, unable to comply.  At its best my Portuguese was at the please
> and thankyou level.
> 



More information about the questions mailing list