[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250305224648.3058-1-hdanton@sina.com>
Date: Thu, 6 Mar 2025 06:46:45 +0800
From: Hillf Danton <hdanton@...a.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: K Prateek Nayak <kprateek.nayak@....com>,
Mateusz Guzik <mjguzik@...il.com>,
"Sapkal, Swapnil" <swapnil.sapkal@....com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pipe_read: don't wake up the writer if the pipe is still full
On Wed, 5 Mar 2025 12:44:34 +0100 Oleg Nesterov <oleg@...hat.com>
> On 03/05, Hillf Danton wrote:
> > See the loop in ___wait_event(),
> >
> > for (;;) {
> > prepare_to_wait_event();
> >
> > // flip
> > if (condition)
> > break;
> >
> > schedule();
> > }
> >
> > After wakeup, waiter will sleep again if condition flips false on the waker
> > side before waiter checks condition, even if condition is atomic, no?
>
> Yes, but in this case pipe_full() == true is correct, this writer can
> safely sleep.
>
No, because no reader is woken up before sleep to make pipe not full.
Powered by blists - more mailing lists