Re: [PATCH] pipe_read: don't wake up the writer if the pipe is still full
From: K Prateek Nayak
Date: Tue Mar 04 2025 - 00:31:42 EST
Hello Linus,
On 3/4/2025 2:16 AM, Linus Torvalds wrote:
On Mon, 3 Mar 2025 at 10:28, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
Stupid question... but do we really need to change the code which update
tail/head if we pack them into a single word?
No. It's only the READ_ONCE() parts that need changing.
See this suggested patch, which does something very similar to what
you were thinking of.
ENTIRELY UNTESTED, but it seems to generate ok code. It might even
generate better code than what we have now.
With the patch on top of commit aaec5a95d596 ("pipe_read: don't wake up
the writer if the pipe is still full"), we've not seen any hangs yet
with a few thousand iterations of short loops, and a few hundred
iterations of larger loop sizes with hackbench.
If you can provide you S-o-b, we can send out an official patch with a
commit log. We'll wait for Oleg's response in case he has any concerns.
Linus
--
Thanks and Regards,
Prateek