Re: [patch V3 04/11] timekeeping: Provide time setter for auxiliary clocks

From: Thomas Gleixner
Date: Fri Jun 27 2025 - 10:18:59 EST


On Thu, Jun 26 2025 at 21:23, John Stultz wrote:
> On Wed, Jun 25, 2025 at 11:38 AM Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>>
>> Add clock_settime(2) support for auxiliary clocks. The function affects the
>> AUX offset which is added to the "monotonic" clock readout of these clocks.
>>
>> Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
>> ---
>
> Minor fretting: I worry a little that the difference here between the
> default timekeeper where set adjusts the REALTIME offset from
> MONOTONIC, and here where it directly adjusts "mono" might confuse
> later readers?

Actually it's not really that different.

In both cases the new offset to the monotonic clock is calculated and
stored in the relevant tk::offs_* member.

The difference is that the core timekeeper operates on xtime, but for
simplicity I chose to calculate the resulting tk::offs_aux directly from
the monotonic base. That's valid with the aux clocks as they don't
need any of the xtime parts.

I added some blurb to it.