Skip to contentSkip to conversation

timekeeping: Initialize TAI offset to 37 seconds

PATCH Applied Miroslav Lichvar 4 participants 4 messages Nov 5 – Nov 9 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore

Miroslav Lichvar

author reviewer
#0 lore raw

PATCH 1/1 timekeeping: Initialize TAI offset to 37 seconds

With Resolution 5 of the 28th CGPM (continuous UTC becoming effective on 20 May 2027) [1] and no leap second announced for the last possible date at the end of the year 2026 [2], no more leap seconds or other leaps in UTC are expected for at least a few hundred years. The TAI-UTC offset can be assumed now to be constant (37 seconds).

Set the offset in the timekeeping initialization to the expected value to not require it to be set in user space via ADJ_TAI. It can still be changed, and leap seconds can still be set, but nothing should be expected to do that anymore. Existing applications are expected to either set the offset to the same value, or not touch it at all if they see it is not zero.

[1] https://www.bipm.org/en/cgpm-2026/resolution-5
[2] https://datacenter.iers.org/data/16/bulletinc-072.txt

Cc Richard Cochran <[email protected]>
Cc David Woodhouse <[email protected]>
---
 kernel/time/timekeeping.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/time/timekeeping.c +4 -0
index dcf47f1ffdcf..e76e44b194da 100644
@@ -34,6 +34,8 @@
 
 #define TK_UPDATE_ALL		(TK_CLEAR_NTP | TK_CLOCK_WAS_SET)
 
+#define TK_INITIAL_TAI_OFFSET	37
+
 enum timekeeping_adv_mode {
 	/* Update timekeeper when a tick has passed */
 	TK_ADV_TICK,
@@ -2091,6 +2093,8 @@ void __init timekeeping_init(void)
 
 	tk_set_wall_to_mono(tks, wall_to_mono);
 
+	__timekeeping_set_tai_offset(tks, TK_INITIAL_TAI_OFFSET);
+
 	/*
 	 * Use TK_UPDATE_ALL so the NTP layer picks up the clocksource's
 	 * cs_tick_adj via ntp_clear(). Clearing NTP here is otherwise
Signature · 1 line
2.56.0
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Miroslav Lichvar

With Resolution 5 of the 28th CGPM (continuous UTC becoming effective on 20 May 2027) [1] and no leap second announced for the last possible date at the end of the year 2026 [2], no more leap seconds or other leaps in UTC are expected for at least a few hundred years. The TAI-UTC offset can be assumed now to be constant (37 seconds).

Set the offset in the timekeeping initialization to the expected value to not require it to be set in user space via ADJ_TAI. It can still be changed, and leap seconds can still be set, but nothing should be expected to do that anymore. Existing applications are expected to either set the offset to the same value, or not touch it at all if they see it is not zero.

Quoted 2 lines

[1] https://www.bipm.org/en/cgpm-2026/resolution-5
[2] https://datacenter.iers.org/data/16/bulletinc-072.txt

For the kernel patch,

Although I don't want that to be taken as any kind of endorsement of the rampant horseshit that is this statement from your [1]:

|recognizing that
|
|    industrial users and the synchronization needs of national critical
|    infrastructures, for example transportation, energy distribution,
|    telecommunication, and space projects require UTC to be continuous
|    without any future adjustment, 

... or of the idea that doing a *larger* jump, much *less* frequently, is a better idea. They should have just inserted either a positive or negative leap second at *every* opportunity instead, to help make sure that bugs are caught.

maintainer
#2 lore raw
In reply to Miroslav Lichvar
Quoted 7 lines · Miroslav Lichvar

With Resolution 5 of the 28th CGPM (continuous UTC becoming effective on 20 May 2027) [1] and no leap second announced for the last possible date at the end of the year 2026 [2], no more leap seconds or other leaps in UTC are expected for at least a few hundred years. The TAI-UTC offset can be assumed now to be constant (37 seconds).

Quoted 6 lines

Set the offset in the timekeeping initialization to the expected value to not require it to be set in user space via ADJ_TAI. It can still be changed, and leap seconds can still be set, but nothing should be expected to do that anymore. Existing applications are expected to either set the offset to the same value, or not touch it at all if they see it is not zero.

Should we also emit a warning if/when applications try to change it?

thanks
-john

#3 lore raw
In reply to Miroslav Lichvar
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     a2fbc5e623e6ad1372804403863ebf94956b2748
Gitweb:        https://git.kernel.org/tip/a2fbc5e623e6ad1372804403863ebf94956b2748
Author:        Miroslav Lichvar <[email protected]>
AuthorDate:    Thu, 05 Nov 2026 14:53:15 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 09 Nov 2026 20:21:47 +01:00

timekeeping: Initialize TAI offset to 37 seconds

With Resolution 5 of the 28th CGPM (continuous UTC becoming effective on 20 May 2027) [1] and no leap second announced for the last possible date at the end of the year 2026 [2], no more leap seconds or other leaps in UTC are expected for at least a few hundred years. The TAI-UTC offset can be assumed now to be constant (37 seconds).

Set the offset in the timekeeping initialization to the expected value to not require it to be set in user space via ADJ_TAI. It can still be changed, and leap seconds can still be set, but nothing should be expected to do that anymore. Existing applications are expected to either set the offset to the same value, or not touch it at all if they see it is not zero.

[1] https://www.bipm.org/en/cgpm-2026/resolution-5
[2] https://datacenter.iers.org/data/16/bulletinc-072.txt

---
 kernel/time/timekeeping.c | 4 ++++
 1 file changed, 4 insertions(+)
kernel/time/timekeeping.c +4 -0
index be72cfd..3668bd2 100644
@@ -34,6 +34,8 @@
 
 #define TK_UPDATE_ALL		(TK_CLEAR_NTP | TK_CLOCK_WAS_SET)
 
+#define TK_INITIAL_TAI_OFFSET	37
+
 enum timekeeping_adv_mode {
 	/* Update timekeeper when a tick has passed */
 	TK_ADV_TICK,
@@ -2095,6 +2097,8 @@ void __init timekeeping_init(void)
 
 	tk_set_wall_to_mono(tks, wall_to_mono);
 
+	__timekeeping_set_tai_offset(tks, TK_INITIAL_TAI_OFFSET);
+
 	/*
 	 * Use TK_UPDATE_ALL so the NTP layer picks up the clocksource's
 	 * cs_tick_adj via ntp_clear(). Clearing NTP here is otherwise