[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241229130543.GC27491@redhat.com>
Date: Sun, 29 Dec 2024 14:05:43 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Manfred Spraul <manfred@...orfullife.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
WangYuli <wangyuli@...ontech.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Christian Brauner <brauner@...nel.org>
Subject: Re: [RESEND PATCH] fs/pipe: Introduce a check to skip sleeping
processes during pipe read/write
On 12/29, Manfred Spraul wrote:
>
> >I think that your patch (and the original patch from WangYuli) has the same
> >proble with pipe_poll()->poll_wait()->__pollwait().
>
> What is the memory barrier for pipe_poll()?
>
> There is poll_wait()->__pollwait()->add_wait_queue()->spin_unlock(). thus
> only store_release.
>
> And then READ_ONCE(), i.e. no memory barrier.
>
> Thus the CPU would be free to load pipe->head and pipe->tail before adding
> the entry to the poll table.
>
> Correct?
Yes, this was my thinking.
See also my initial reply to WangYuli
https://lore.kernel.org/all/20241226160007.GA11118@redhat.com/
Do you agree?
Oleg.
Powered by blists - more mailing lists