Re: [PATCH RFC 5/9] futex: Use accessor for hrtimer_sleeper ->task field in waitwake.c

From: Dmitry Ilvokhin

Date: Tue Aug 04 2026 - 13:41:16 EST


On Thu, Jul 30, 2026 at 05:40:15PM -0700, Paul E. McKenney wrote:
> The hrtimer_sleeper structure's ->task field is used as a flag to indicate
> that the associated hrtimer has expired. This means that the hrtimer
> handler can be storing to this field while other code is loading from it
> to check for expiry. Note that additional races appear for hrtimers that
> can be restarted, which could be argued to be a user error. However, that
> is no reason to let the compiler introduce additional confusion, and to
> this end, the hrtimer_sleeper_task_get() was introduced, use of which also
> has the benefit of avoiding open-code access to hrtimer_sleeper innards.
>
> Therefore, apply this accessor to kernel/futex/waitwake.c.
>
> KCSAN located this issue.
>
> Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>

Reviewed-by: Dmitry Ilvokhin <d@xxxxxxxxxxxx>