[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250307123442.GD5963@redhat.com>
Date: Fri, 7 Mar 2025 13:34:43 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Hillf Danton <hdanton@...a.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
In case I wasn't clear...
On 03/07, Oleg Nesterov wrote:
>
> On 03/07, Hillf Danton wrote:
> >
> > On Fri, 7 Mar 2025 11:54:56 +0530 K Prateek Nayak <kprateek.nayak@....com>
> > >> step-03
> > >> task-118766 new reader
> > >> makes pipe empty
> > >
> > >Reader seeing a pipe full should wake up a writer allowing 118768 to
> > >wakeup again and fill the pipe. Am I missing something?
> > >
> > Good catch, but that wakeup was cut off [2,3]
Please note that "that wakeup" was _not_ removed by the patch below.
"That wakeup" is another wakeup pipe_read() does before return:
if (wake_writer)
wake_up_interruptible_sync_poll(&pipe->wr_wait, ...);
And wake_writer must be true if this reader changed the pipe_full()
condition from T to F.
Note also that pipe_read() won't sleep if it has read even one byte.
> > [2] https://lore.kernel.org/lkml/20250304123457.GA25281@redhat.com/
> > [3] https://lore.kernel.org/all/20250210114039.GA3588@redhat.com/
>
> Why do you think
>
> [PATCH v2 1/1] pipe: change pipe_write() to never add a zero-sized buffer
> https://lore.kernel.org/all/20250210114039.GA3588@redhat.com/
>
> can make any difference ???
>
> Where do you think a zero-sized buffer with ->len == 0 can come from?
Oleg.
Powered by blists - more mailing lists