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

From: Andreas Hindborg

Date: Wed Nov 25 2026 - 14:27:49 EST



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

Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>