Re: [RFC PATCH 10/10] x86: snapshot thread flags
From: Thomas Gleixner
Date: Sat Jun 19 2021 - 18:54:20 EST
On Wed, Jun 09 2021 at 13:20, Mark Rutland wrote:
> Some thread flags can be set remotely, and so even when IRQs are
> disabled, the flags can change under our feet. Generally this is
> unlikely to cause a problem in practice, but it is somewhat unsound, and
> KCSAN will legitimately warn that there is a data race.
>
> To avoid such issues, we should snapshot the flags prior to using them.
> Let's use the new helpers to do so on x86.
To avoid such issues, a snapshot of the flags has to be taken prior to
using them. Some places already use READ_ONCE() for that, others do
not.
Convert them all to the new flag accessor helpers.
Other than that.
Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>