freebsd-src/sys
Warner Losh 4f2073fb4c Fix leap second processing by the kernel time keeping routines.
Before, we would add/subtract the leap second when the system had been
up for an even multiple of days, rather than at the end of the day, as
a leap second is defined (at least wrt ntp).  We do this by
calculating the notion of UTC earlier in the loop, and passing that to
get it adjusted.  Any adjustments that ntp_update_second makes to this
time are then transferred to boot time.  We can't pass it either the
boot time or the uptime because their sum is what determines when a
leap second is needed.  This code adds an extra assignment and two
extra compare in the typical case, which is as cheap as I could made
it.

I have confirmed with this code the kernel time does the correct thing
for both positive and negative leap seconds.  Since the ntp interface
doesn't allow for +2 or -2, those cases can't be tested (and the folks
in the know here say there will never be a +2s or -2s leap event, but
rather two +1s or -1s leap events).

There will very likely be no leap seconds for a while, given how the
earth is speeding up and slowing down, so there will be plenty of time
for this fix to propigate.  UT1-UTC is currently at "about -0.4s" and
decrementing by .1s every 8 months or so.  6 * 8 is 48 months, or 4
years.

-stable has different code, but a similar bug that was introduced
about the time of the last leap second, which is why nobody has
noticed until now.

MFC After: 3 weeks
Reviewed by: phk

"Furthermore, leap seconds must die." -- Cato the Elder
2003-06-25 21:23:51 +00:00
..
alpha Add a f_vnode field to struct file. 2003-06-22 08:41:43 +00:00
amd64 MFi386 2003-06-23 06:10:52 +00:00
arm sys/sys/limits.h: 2003-05-19 20:29:07 +00:00
boot When looking for the ':' separator in the root path, don't go past 2003-06-16 20:48:56 +00:00
cam Merge common XPT_CALC_GEOMETRY functions into a single convenience function. 2003-06-14 22:17:41 +00:00
coda Remove in toto coda_strategy which incorrectly implemented vop_panic(); 2003-06-15 18:45:15 +00:00
compat Add a f_vnode field to struct file. 2003-06-22 08:41:43 +00:00
conf MFi386: revision 1.446. 2003-06-25 15:19:04 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r116801, 2003-06-25 06:06:52 +00:00
crypto Use __FBSDID(). 2003-06-10 21:44:29 +00:00
ddb Rename P_THREADED to P_SA. P_SA means a process is using scheduler 2003-06-15 00:31:24 +00:00
dev Set pointers to NULL after free() to prevent multiple free(). 2003-06-25 19:58:38 +00:00
fs change dev_t to struct cdev * to match ufs. This fixes fstat for cd9660 2003-06-24 22:11:20 +00:00
geom Sleep on "-" in our normal state to simplify debugging. 2003-06-18 10:33:09 +00:00
gnu Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementations 2003-06-15 18:53:00 +00:00
i4b Use __FBSDID(). 2003-06-11 00:01:05 +00:00
i386 Add a f_vnode field to struct file. 2003-06-22 08:41:43 +00:00
ia64 Add TLS related relocation. 2003-06-19 06:51:43 +00:00
isa Force media autodetection if the device has lost its parameter table. 2003-06-16 08:42:20 +00:00
isofs/cd9660 change dev_t to struct cdev * to match ufs. This fixes fstat for cd9660 2003-06-24 22:11:20 +00:00
kern Fix leap second processing by the kernel time keeping routines. 2003-06-25 21:23:51 +00:00
libkern Use __FBSDID(). 2003-06-11 05:37:42 +00:00
modules module for atheros hal 2003-06-25 14:43:50 +00:00
net add "autoselect" mode and "auto" alias: these let you reset the 2003-06-25 15:03:05 +00:00
net80211 fix tcpdump -y IEEE802_11; NBPFILTER was a holdover from netbsd compatibility 2003-06-25 17:42:36 +00:00
netatalk - Use if_broadcastaddr from struct ifnet rather than relying on 2003-03-21 17:53:16 +00:00
netatm Use __FBSDID(). 2003-06-11 07:22:30 +00:00
netgraph Fix a comment 2003-06-25 20:58:35 +00:00
netinet remove unused file (ipfw2 is the default in RELENG_5 and above; the old 2003-06-24 07:12:11 +00:00
netinet6 Do not attempt to access to inp_socket fields if the socket is in the TIME_WAIT 2003-06-17 00:31:30 +00:00
netipsec Introduce an M_ASSERTPKTHDR() macro which performs the very common task 2003-04-08 14:25:47 +00:00
netipx Use __FBSDID(). 2003-06-11 05:37:42 +00:00
netkey Use __FBSDID(). 2003-06-11 05:37:42 +00:00
netnatm Use __FBSDID(). 2003-06-11 05:37:42 +00:00
netncp Use __FBSDID(). 2003-06-11 05:37:42 +00:00
netsmb Add a f_vnode field to struct file. 2003-06-22 08:41:43 +00:00
nfs Back out M_* changes, per decision of the TRB. 2003-02-19 05:47:46 +00:00
nfsclient Lock the vm object when freeing a page. 2003-06-17 05:17:00 +00:00
nfsserver Fix a bug in nfsrv_read() that caused the replies to certain NFSv3 2003-06-24 19:04:26 +00:00
opencrypto Initialize struct fileops with C99 sparse initialization. 2003-06-18 18:16:40 +00:00
pc98 Replace evil abuse of geteblk() with malloc(9). 2003-06-16 07:41:47 +00:00
pccard OLDCARD is OBSOLETE_IN_6. Tag it as such. 2003-06-12 04:46:43 +00:00
pci Add a PCI ID for the Apollo Pro 133A. 2003-06-23 11:15:22 +00:00
posix4 Use __FBSDID(). 2003-06-11 06:34:30 +00:00
powerpc Remove unused bootpath[] variable. It conflicted with a declaration 2003-06-25 08:11:29 +00:00
rpc
security Redesign the externalization APIs from the MAC Framework to 2003-06-23 01:26:34 +00:00
sparc64 remove unnecessary comment. We do what the comments says we need to. 2003-06-24 21:37:49 +00:00
sys Remove an '_' which was surplus to requirements. 2003-06-25 08:30:45 +00:00
tools Don't check the state of the vnode interlock if the specification says 2003-06-22 21:20:06 +00:00
ufs Lock the vm object when freeing pages. 2003-06-15 21:50:38 +00:00
vm Move the pcpu lock out of the uma_cache and instead have a single set 2003-06-25 20:49:48 +00:00
Makefile Exclude sys/boot for amd64. There are still toolchain issues to deal 2003-05-08 06:35:39 +00:00