Re: [RFC PATCH 10/10] x86: snapshot thread flags

From: Mark Rutland
Date: Mon Jun 21 2021 - 04:35:30 EST


On Sun, Jun 20, 2021 at 12:30:32AM +0200, Thomas Gleixner wrote:
> 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.

I'll use that wording consistently throughout the series.

> Other than that.
>
> Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>

Thanks!

Mark.