Re: [PATCH RFC 2/9] aio: Use accessor for hrtimer_sleeper ->task field

Christian Brauner <[email protected]> Fri, 31 Jul 2026 14:57:57 +0200
Newsgroups gmane.linux.kernel.aio.general,gmane.linux.kernel,gmane.linux.file-systems
Message-ID <20260731-ritzen-ratgeber-fastnacht-519674d2de1d@brauner>
On 2026-07-30 17:40 -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.
> 
> KCSAN located this issue.
> 
> Signed-off-by: Paul E. McKenney <[email protected]>
> Cc: Benjamin LaHaise <[email protected]>
> Cc: Alexander Viro <[email protected]>
> Cc: Christian Brauner <[email protected]>
> Cc: Jan Kara <[email protected]>
> Cc: Anna-Maria Behnsen <[email protected]>
> Cc: Frederic Weisbecker <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: <[email protected]>
> Cc: <[email protected]>
> ---

Reviewed-by: Christian Brauner (Amutable) <[email protected]>


--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to [email protected].  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"[email protected]">[email protected]</a>