Re: [PATCH] pipe_read: don't wake up the writer if the pipe is still full

From: Oleg Nesterov
Date: Wed Feb 26 2025 - 12:20:49 EST


On 02/26, Mateusz Guzik wrote:
>
> On Wed, Feb 26, 2025 at 2:19 PM Mateusz Guzik <mjguzik@xxxxxxxxx> wrote:
> >
> Now that I sent the e-mail, I realized the page would have unread data
> after some offset, so there is no room to *append* to it, unless one
> wants to memmove everythiing back.

Yes, but... even "memmove everything back" won't help if
pipe->ring_size > 1 (PIPE_DEF_BUFFERS == 16 by default).

> However, the suggestion below stands:

Agreed, any additional info can help.

Oleg.

> > As for the bug, I don't see anything obvious myself.
> >
> > However, I think there are 2 avenues which warrant checking.
> >
> > Sapkal, if you have time, can you please boot up the kernel which is
> > more likely to run into the problem and then run hackbench as follows:
> >
> > 1. with 1 fd instead of 20:
> >
> > /usr/bin/hackbench -g 16 -f 1 --threads --pipe -l 100000 -s 100
> >
> > 2. with a size which divides 4096 evenly (e.g., 128):
> >
> > /usr/bin/hackbench -g 1 -f 20 --threads --pipe -l 100000 -s 128
>
>
>
> --
> Mateusz Guzik <mjguzik gmail.com>
>