[ntp:questions] Leap seconds

David L. Mills mills at udel.edu
Tue Jan 25 02:41:11 UTC 2005


Danny,

The model assumed by NTP, and implemented in the kernel modifications 
that leave here, is to avoid setting the clock backward unless the step 
is more than two seconds. Otherwise, the clock is simply stopped while 
time catches up, but with the proviso that every read advances the clock 
by one microsecond or nanosecond, as appropriate. Thus the clock is 
always monotonic increasing. This design has not always been preserved 
by other kernel implementors.

Since the minimum time between clock reads is some 400 ns for the 
fastest machine I can tickle (Blade 1500), the clock can get ahead no 
more than 2.5 ms if read in a loop during that second. Unless read 
continuously after that extremely unlikely scenario, the error will be 
quickly amortized.

Dave

mayer at gis.net wrote:

> Brad Knowles wrote:
> 
>>At 6:18 PM -0200 2005-01-19, Alain wrote:
>>
>>
>>> Sorry, I believe that my question was not clear: In which way will
> 
> it
> 
>>> be handled? Skeweing or leaping?
>>
>>	I'd have to check the source code, but I believe that the leap
>>second is probably passed through to the underlying OS, which should
>>be able to handle it.  In other words, nothing special is done other
>>than identifying that a leap second will occur on the appropriate
>>minute of the appropriate day of the appropriate month.
>>
> 
> 
> NTP is the one that decides how much to change the clock and
> tells the O/S. Moving the clock backward by 1 second, which is
> in effect what a leap-second does, can have major negative effects
> on systems that depend on the time being a monotonically increasing
> variable.
> 
> Having said that I haven't checked the code to see what it
> actually does, but I'd be very surprised if it did the wrong
> thing.
> 
> Danny
> 
> 
>>--
>>Brad Knowles, <brad at stop.mail-abuse.org>
>>
>>"Those who would give up essential Liberty, to purchase a little
>>temporary Safety, deserve neither Liberty nor Safety."
>>
>>     -- Benjamin Franklin (1706-1790), reply of the Pennsylvania
>>     Assembly to the Governor, November 11, 1755
>>
>>   SAGE member since 1995.  See <http://www.sage.org/> for more info.
> 
> 



More information about the questions mailing list