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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 10 Mar 2025 at 13:34, Hillf Danton <hdanton@xxxxxxxx> wrote:
>
> The step-03 in my scenario [1] shows a reader sleeps at line-370 after
> making the pipe empty, so after your change that cuts the chance for
> waking up writer, who will wake up the sleeping reader? Nobody.

But step-03 will wake the writer.

And no, nobody will wake readers, because the pipe is empty. Only the
next writer that adds data to the pipe should wake any readers.

Note that the logic that sets "wake_writer" and "was_empty" is all
protected by the pipe semaphore. So there are no races wrt figuring
out "should we wake readers/writers".

So I really think you need to very explicitly point to what you think
the problem is. Not point to some other email. Write out all out in
full and explain.

               Linus




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux