Re: PATCH? avoid the unnecessary wakeups in pipe_read()
From: Linus Torvalds
Date: Sun Dec 29 2024 - 12:27:49 EST
On Sun, 29 Dec 2024 at 05:58, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> If I read this code correctly, in this case the child will wakeup the parent
> 4095 times for no reason, pipe_writable() == !pipe_pull() will still be true
> until the last read(fd[0], &c, 1) does
Ack, that patch looks sane to me.
Only wake writer if we actually released a pipe slot, and it was full
before we did so.
Makes sense.
Linus