Skip to content

RFC Fix leap seconds and add tai clock

Richard Cochran lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest6 patches 30 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6time: remove obsolete declarationinclude/linux/time.h+0 -11 reply
2/6ntp: remove useless parameterkernel/time/ntp.c+4 -41 reply
3/6time: keep track of the pending utc/tai thresholdkernel/time/timekeeping.c+14 -021 replies
4/6time: introduce leap second functional interfacekernel/time/leap-seconds.h kernel/time/timekeeping.c+150 -05 replies
5/6time: move leap second management into time keeping coreinclude/linux/time.h kernel/time/ntp.c kernel/time/timekeeping.c+73 -682 replies
6/6time: Add CLOCK_TAI clockidinclude/linux/time.h kernel/posix-timers.c kernel/time/timekeeping.c+44 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH RFC V2 0/6] Fix leap seconds and add tai clock

In honor of this summer's new leap second, this patch series aim to fix the incorrect time values reported during a leap second. This second version of the patch series does not change the core time keeping code, but rather affects only the adjtimex interface.

Of course, the POSIX UTC system is broken by design, and the Linux kernel cannot fix that. However, what we can do is correctly execute leap seconds and report the time variables (UTC time, TAI offset, and leap second status) with consistency.

Since commit 6b43ae8a, the leap second is applied on the first timer tick after the actual deadline, resulting in incorrect time values from gettimeofday and friends. In contrast to V1, this series does not address that issue but rather adds extra checks into the adjtimex code path, with the effect of always providing correct UTC time values, even during a leap second.

The first two patches merely clean up some cruft I noticed along the way while working on this series.

John Stultz (1):
time: Add CLOCK_TAI clockid

Richard Cochran (5):
time: remove obsolete declaration
ntp: remove useless parameter
time: keep track of the pending utc/tai threshold
time: introduce leap second functional interface
time: move leap second management into time keeping core

 include/linux/time.h       |    9 +-
 kernel/posix-timers.c      |   10 ++
 kernel/time/leap-seconds.h |   21 ++++
 kernel/time/ntp.c          |   90 ++++++------------
 kernel/time/timekeeping.c  |  228 ++++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 283 insertions(+), 75 deletions(-)
 create mode 100644 kernel/time/leap-seconds.h
Signature · 1 line
1.7.2.5