Re: [PATCH] sched: Fix race in rt_mutex_pre_schedule by removing non-atomic fetch_and_set
From: Sebastian Andrzej Siewior
Date: Tue Aug 26 2025 - 10:33:24 EST
On 2025-08-26 09:56:15 [-0400], Steven Rostedt wrote:
> Honestly, without adding a READ_ONCE() or barrier() I don't see how your
> change would prevent the compiler from making the code any different?
Other than that, that flag is supposed to be only set/ cleared by the
thread itself. There should be no need for it to be atomic.
> It may have "fixed" your issue because the compiler may have done things
> differently, but this change doesn't guarantee anything.
>
> Also, could you show an example of how current->sched_rt_mutex could be
> corrupted?
That would be important.
> -- Steve
Sebastian