Re: [GIT PULL] pipe: nonblocking rw for io_uring

From: Peter Zijlstra
Date: Tue Apr 25 2023 - 15:49:27 EST


On Tue, Apr 25, 2023 at 10:20:31AM -0700, Linus Torvalds wrote:

> But the more I look at it, the more I'm convinced that our pattern of
>
> old = READ_ONCE(rq->fence.error);
> do {
> if (fatal_error(old))
> return false;
> } while (!try_cmpxchg(&rq->fence.error, &old, error));
>
> (to pick one random user) is simply horribly wrong.

The last time this came up I shared your view however Mark argued for
the READ_ONCE() thusly:

https://lore.kernel.org/all/Y71LoCIl+IFdy9D8@FVFF77S0Q05N/T/#u