]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
timekeeping: Add AUX offset to struct timekeeper
authorThomas Gleixner <tglx@linutronix.de>
Mon, 19 May 2025 08:33:32 +0000 (10:33 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 19 Jun 2025 12:28:24 +0000 (14:28 +0200)
This offset will be used in the time getters of auxiliary clocks. It is
added to the "monotonic" clock readout.

As auxiliary clocks do not utilize the offset fields of the core time
keeper, this is just an alias for offs_tai, so that the cache line layout
stays the same.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <jstultz@google.com>
Link: https://lore.kernel.org/all/20250519083026.533486349@linutronix.de
include/linux/timekeeper_internal.h

index 1690eda1c7c3066d317c22bea07600d387553ff6..ca79938b62f396afd503e0cf06bbecf6f95cfce4 100644 (file)
@@ -67,6 +67,7 @@ struct tk_read_base {
  * @offs_real:                 Offset clock monotonic -> clock realtime
  * @offs_boot:                 Offset clock monotonic -> clock boottime
  * @offs_tai:                  Offset clock monotonic -> clock tai
+ * @offs_aux:                  Offset clock monotonic -> clock AUX
  * @coarse_nsec:               The nanoseconds part for coarse time getters
  * @id:                                The timekeeper ID
  * @tkr_raw:                   The readout base structure for CLOCK_MONOTONIC_RAW
@@ -113,6 +114,9 @@ struct tk_read_base {
  * @monotonic_to_boottime is a timespec64 representation of @offs_boot to
  * accelerate the VDSO update for CLOCK_BOOTTIME.
  *
+ * @offs_aux is used by the auxiliary timekeepers which do not utilize any
+ * of the regular timekeeper offset fields.
+ *
  * The cacheline ordering of the structure is optimized for in kernel usage of
  * the ktime_get() and ktime_get_ts64() family of time accessors. Struct
  * timekeeper is prepended in the core timekeeping code with a sequence count,
@@ -139,7 +143,10 @@ struct timekeeper {
        struct timespec64       wall_to_monotonic;
        ktime_t                 offs_real;
        ktime_t                 offs_boot;
-       ktime_t                 offs_tai;
+       union {
+               ktime_t         offs_tai;
+               ktime_t         offs_aux;
+       };
        u32                     coarse_nsec;
        enum timekeeper_ids     id;