Re: [PATCH RFC 9/9] futex: Use accessor for hrtimer_sleeper ->task field in requeue
From: Paul E. McKenney
Date: Mon Aug 03 2026 - 11:58:42 EST
On Mon, Aug 03, 2026 at 12:21:23PM -0300, André Almeida wrote:
> Em 30/07/2026 21:40, Paul E. McKenney escreveu:
> > 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 handle_early_requeue_pi_wakeup().
> >
> > KCSAN located this issue.
> >
> > Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
> > Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> > Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> > Cc: Darren Hart <dvhart@xxxxxxxxxxxxx>
> > Cc: Davidlohr Bueso <dave@xxxxxxxxxxxx>
> > Cc: "André Almeida" <andrealmeid@xxxxxxxxxx>
> > Cc: Anna-Maria Behnsen <anna-maria@xxxxxxxxxxxxx>
> > Cc: Frederic Weisbecker <frederic@xxxxxxxxxx>
> > Cc: Thomas Gleixner <tglx@xxxxxxxxxx>
> Reviewed-by: André Almeida <andrealmeid@xxxxxxxxxx>
Thank you! I will apply both on my next rebase.
Thanx, Paul