Re: [PATCH v4] rust: hrtimer: add active() method to query timer state

From: Andreas Hindborg

Date: Mon Nov 30 2026 - 11:12:18 EST


Andreas Hindborg <a.hindborg@xxxxxxxxxx> writes:

> On Wed, 25 Nov 2026 13:34:41 +0100, Andreas Hindborg wrote:
>> Add an `active()` method to HrTimer that returns true if the timer is in
>> the started or running states. This wraps the kernel's hrtimer_active()
>> function.
>>
>> Unlike a direct read of `node.expires`, this does not race with a
>> concurrent start operation. hrtimer_active() reads the timer state inside a
>> seqcount retry loop and re-reads `timer->base` with READ_ONCE(), and the
>> core documents that it must not return a false negative. No exclusive
>> access to the timer is therefore required, and the SAFETY comment reflects
>> that.
>>
>> [...]
>
> Applied, thanks!
>
> [1/1] rust: hrtimer: add active() method to query timer state
> commit: 5c057c3a0b980e0b923211fd49d7bda0e5bf945f
>

I botched the one above, applied the patch correctly now:

Applied, thanks!

[1/1] rust: hrtimer: add active() method to query timer state
commit: 8ecc26b396a2b587088e8ffd4d4b77d878f1eb33

Best regards,
Andreas Hindborg