Skip to contentSkip to conversation

timekeeping: Move the vDSO update declarations into a private header

PATCH Applied Thomas Weißschuh 2 participants 5 messages Jul 7 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

cover timekeeping: Move the vDSO update declarations into a private header

All architectures are now fully using the generic vDSO infrastructure. They don't need these declarations anymore to implement the functions in architecture-specific code.

Move them to the private header.

---
Thomas Weißschuh (2):
timekeeping: Fold vdso_time_update_aux() declarations into the generic ifdeffery
timekeeping: Move the vDSO update declarations into a private header

 include/linux/timekeeper_internal.h | 21 ---------------------
 kernel/time/time.c                  |  1 +
 kernel/time/timekeeping_internal.h  | 21 +++++++++++++++++++++
 3 files changed, 22 insertions(+), 21 deletions(-)

---
base-commit: a73d7f98e41a96d6e1bcb0e731ab185d9d67878e
change-id: 20260706-timekeeping-header-cleanup-22ba511e990f

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
#1 lore raw

PATCH 1/2 timekeeping: Fold vdso_time_update_aux() declarations into the generic ifdeffery

The only caller of vdso_time_update_aux() is already gated behind CONFIG_POSIX_AUX. The additional check in the header files is not necessary.

Remove it and then fold the declarations into the existing CONFIG_GENERIC_GETTIMEOFDAY ifdeffery.

---
 include/linux/timekeeper_internal.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
include/linux/timekeeper_internal.h +4 -6
index 4486dfd5d0de..58c83d6e65b3 100644
@@ -194,6 +194,7 @@ struct timekeeper {
 
 extern void update_vsyscall(struct timekeeper *tk);
 extern void update_vsyscall_tz(void);
+extern void vdso_time_update_aux(struct timekeeper *tk);
 
 #else
 
@@ -203,12 +204,9 @@ static inline void update_vsyscall(struct timekeeper *tk)
 static inline void update_vsyscall_tz(void)
 {
 }
-#endif
-
-#if defined(CONFIG_GENERIC_GETTIMEOFDAY) && defined(CONFIG_POSIX_AUX_CLOCKS)
-extern void vdso_time_update_aux(struct timekeeper *tk);
-#else
-static inline void vdso_time_update_aux(struct timekeeper *tk) { }
+static inline void vdso_time_update_aux(struct timekeeper *tk)
+{
+}
 #endif
 
 #endif /* _LINUX_TIMEKEEPER_INTERNAL_H */
Signature · 1 line
2.55.0
#2 lore raw

[tip: timers/core] timekeeping: Fold vdso_time_update_aux() declarations into the generic ifdeffery

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:     6e435911394b05c91b92d4c332c455ec569e22fb
Gitweb:        https://git.kernel.org/tip/6e435911394b05c91b92d4c332c455ec569e22fb
Author:        Thomas Weißschuh <[email protected]>
AuthorDate:    Tue, 07 Jul 2026 08:07:14 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 07 Jul 2026 23:48:08 +02:00

timekeeping: Fold vdso_time_update_aux() declarations into the generic ifdeffery

The only caller of vdso_time_update_aux() is already gated behind CONFIG_POSIX_AUX. The additional check in the header files is not necessary.

Remove it and then fold the declarations into the existing CONFIG_GENERIC_GETTIMEOFDAY ifdeffery.

---
 include/linux/timekeeper_internal.h | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
include/linux/timekeeper_internal.h +4 -6
index 4486dfd..58c83d6 100644
@@ -194,6 +194,7 @@ struct timekeeper {
 
 extern void update_vsyscall(struct timekeeper *tk);
 extern void update_vsyscall_tz(void);
+extern void vdso_time_update_aux(struct timekeeper *tk);
 
 #else
 
@@ -203,12 +204,9 @@ static inline void update_vsyscall(struct timekeeper *tk)
 static inline void update_vsyscall_tz(void)
 {
 }
-#endif
-
-#if defined(CONFIG_GENERIC_GETTIMEOFDAY) && defined(CONFIG_POSIX_AUX_CLOCKS)
-extern void vdso_time_update_aux(struct timekeeper *tk);
-#else
-static inline void vdso_time_update_aux(struct timekeeper *tk) { }
+static inline void vdso_time_update_aux(struct timekeeper *tk)
+{
+}
 #endif
 
 #endif /* _LINUX_TIMEKEEPER_INTERNAL_H */
#3 lore raw

PATCH 2/2 timekeeping: Move the vDSO update declarations into a private header

In reply to Thomas Weißschuh

All architectures are now fully using the generic vDSO infrastructure. They don't need these declarations anymore to implement the functions in architecture-specific code.

Move them to the private header.

---
 include/linux/timekeeper_internal.h | 19 -------------------
 kernel/time/time.c                  |  1 +
 kernel/time/timekeeping_internal.h  | 21 +++++++++++++++++++++
 3 files changed, 22 insertions(+), 19 deletions(-)
include/linux/timekeeper_internal.h +0 -19
index 58c83d6e65b3..264db7c9c071 100644
@@ -190,23 +190,4 @@ struct timekeeper {
 	s32			tai_offset;
 };
 
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
-
-extern void update_vsyscall(struct timekeeper *tk);
-extern void update_vsyscall_tz(void);
-extern void vdso_time_update_aux(struct timekeeper *tk);
-
-#else
-
-static inline void update_vsyscall(struct timekeeper *tk)
-{
-}
-static inline void update_vsyscall_tz(void)
-{
-}
-static inline void vdso_time_update_aux(struct timekeeper *tk)
-{
-}
-#endif
-
 #endif /* _LINUX_TIMEKEEPER_INTERNAL_H */
kernel/time/time.c +1 -0
index 0dd63a91e7c5..d1a7efd80bf5 100644
@@ -42,6 +42,7 @@
 
 #include <generated/timeconst.h>
 #include "timekeeping.h"
+#include "timekeeping_internal.h"
 
 /*
  * The timezone where the local system is located.  Used as a default by some
kernel/time/timekeeping_internal.h +21 -0
index 973ede670a36..6d719b8e5ea2 100644
@@ -6,6 +6,8 @@
 #include <linux/spinlock.h>
 #include <linux/time.h>
 
+struct timekeeper;
+
 /*
  * timekeeping debug functions
  */
@@ -48,4 +50,23 @@ void timekeeper_unlock_irqrestore(unsigned long flags);
 /* NTP specific interface to access the current seconds value */
 long ktime_get_ntp_seconds(unsigned int id);
 
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
+
+extern void update_vsyscall(struct timekeeper *tk);
+extern void update_vsyscall_tz(void);
+extern void vdso_time_update_aux(struct timekeeper *tk);
+
+#else
+
+static inline void update_vsyscall(struct timekeeper *tk)
+{
+}
+static inline void update_vsyscall_tz(void)
+{
+}
+static inline void vdso_time_update_aux(struct timekeeper *tk)
+{
+}
+#endif
+
 #endif /* _TIMEKEEPING_INTERNAL_H */
Signature · 1 line
2.55.0
#4 lore raw
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:     79bd39c58f2c6fdbc5fb6300d309606f3cb84ab8
Gitweb:        https://git.kernel.org/tip/79bd39c58f2c6fdbc5fb6300d309606f3cb84ab8
Author:        Thomas Weißschuh <[email protected]>
AuthorDate:    Tue, 07 Jul 2026 08:07:15 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Tue, 07 Jul 2026 23:48:08 +02:00

timekeeping: Move the vDSO update declarations into a private header

All architectures are now fully using the generic vDSO infrastructure. They don't need these declarations anymore to implement the functions in architecture-specific code.

Move them to the private header.

---
 include/linux/timekeeper_internal.h | 19 -------------------
 kernel/time/time.c                  |  1 +
 kernel/time/timekeeping_internal.h  | 21 +++++++++++++++++++++
 3 files changed, 22 insertions(+), 19 deletions(-)
include/linux/timekeeper_internal.h +0 -19
index 58c83d6..264db7c 100644
@@ -190,23 +190,4 @@ struct timekeeper {
 	s32			tai_offset;
 };
 
-#ifdef CONFIG_GENERIC_GETTIMEOFDAY
-
-extern void update_vsyscall(struct timekeeper *tk);
-extern void update_vsyscall_tz(void);
-extern void vdso_time_update_aux(struct timekeeper *tk);
-
-#else
-
-static inline void update_vsyscall(struct timekeeper *tk)
-{
-}
-static inline void update_vsyscall_tz(void)
-{
-}
-static inline void vdso_time_update_aux(struct timekeeper *tk)
-{
-}
-#endif
-
 #endif /* _LINUX_TIMEKEEPER_INTERNAL_H */
kernel/time/time.c +1 -0
index 0dd63a9..d1a7efd 100644
@@ -42,6 +42,7 @@
 
 #include <generated/timeconst.h>
 #include "timekeeping.h"
+#include "timekeeping_internal.h"
 
 /*
  * The timezone where the local system is located.  Used as a default by some
kernel/time/timekeeping_internal.h +21 -0
index 973ede6..6d719b8 100644
@@ -6,6 +6,8 @@
 #include <linux/spinlock.h>
 #include <linux/time.h>
 
+struct timekeeper;
+
 /*
  * timekeeping debug functions
  */
@@ -48,4 +50,23 @@ void timekeeper_unlock_irqrestore(unsigned long flags);
 /* NTP specific interface to access the current seconds value */
 long ktime_get_ntp_seconds(unsigned int id);
 
+#ifdef CONFIG_GENERIC_GETTIMEOFDAY
+
+extern void update_vsyscall(struct timekeeper *tk);
+extern void update_vsyscall_tz(void);
+extern void vdso_time_update_aux(struct timekeeper *tk);
+
+#else
+
+static inline void update_vsyscall(struct timekeeper *tk)
+{
+}
+static inline void update_vsyscall_tz(void)
+{
+}
+static inline void vdso_time_update_aux(struct timekeeper *tk)
+{
+}
+#endif
+
 #endif /* _TIMEKEEPING_INTERNAL_H */