Skip to content

Commit 180d8b4

Browse files
committed
timekeeping: Add AUX offset to struct timekeeper
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
1 parent c85f5ab commit 180d8b4

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

include/linux/timekeeper_internal.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ struct tk_read_base {
6767
* @offs_real: Offset clock monotonic -> clock realtime
6868
* @offs_boot: Offset clock monotonic -> clock boottime
6969
* @offs_tai: Offset clock monotonic -> clock tai
70+
* @offs_aux: Offset clock monotonic -> clock AUX
7071
* @coarse_nsec: The nanoseconds part for coarse time getters
7172
* @id: The timekeeper ID
7273
* @tkr_raw: The readout base structure for CLOCK_MONOTONIC_RAW
@@ -113,6 +114,9 @@ struct tk_read_base {
113114
* @monotonic_to_boottime is a timespec64 representation of @offs_boot to
114115
* accelerate the VDSO update for CLOCK_BOOTTIME.
115116
*
117+
* @offs_aux is used by the auxiliary timekeepers which do not utilize any
118+
* of the regular timekeeper offset fields.
119+
*
116120
* The cacheline ordering of the structure is optimized for in kernel usage of
117121
* the ktime_get() and ktime_get_ts64() family of time accessors. Struct
118122
* timekeeper is prepended in the core timekeeping code with a sequence count,
@@ -139,7 +143,10 @@ struct timekeeper {
139143
struct timespec64 wall_to_monotonic;
140144
ktime_t offs_real;
141145
ktime_t offs_boot;
142-
ktime_t offs_tai;
146+
union {
147+
ktime_t offs_tai;
148+
ktime_t offs_aux;
149+
};
143150
u32 coarse_nsec;
144151
enum timekeeper_ids id;
145152

0 commit comments

Comments
 (0)