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 03/11, Hillf Danton wrote:
>
> On Mon, 10 Mar 2025 13:43:42 +0100 Oleg Nesterov
> >
> > Hmm. I don't understand you, again.
> >
> > OK, once some writer writes at least one byte (this will make the
> > pipe_empty() condition false) and wakes this reader up.
> >
> > If you meant something else, say, if you referred to you previous
> > scenario, please clarify your question.
> >
> 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,

We are circling.

Once again, in this case "wake_writer" can't be true when the reader does
wait_event(rd_wait), this code can be replaced with BUG_ON(wake_writer).
So that change cuts nothing. It simply has no effect in this case.

> who will wake up the sleeping reader? Nobody.
>
> Feel free to check my scenario again.
>
> step-03
> 	task-118766 new reader
> 	makes pipe empty
> 	sleeps
>
> [1] https://lore.kernel.org/lkml/20250307060827.3083-1-hdanton@xxxxxxxx/

First of all, task-118766 won't sleep unless it calls read() again.


[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