Skip to content
Snippets Groups Projects
Unverified Commit aaec5a95 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Christian Brauner
Browse files

pipe_read: don't wake up the writer if the pipe is still full


wake_up(pipe->wr_wait) makes no sense if pipe_full() is still true after
the reading, the writer sleeping in wait_event(wr_wait, pipe_writable())
will check the pipe_writable() == !pipe_full() condition and sleep again.

Only wake the writer if we actually released a pipe buf, and the pipe was
full before we did so.

Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/all/20241229135737.GA3293@redhat.com/
Link: https://lore.kernel.org/r/20250102140715.GA7091@redhat.com


Reported-by: default avatarWangYuli <wangyuli@uniontech.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent d2fc0ed5
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment