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/06, Hillf Danton wrote:
>
> On Wed, 5 Mar 2025 12:44:34 +0100 Oleg Nesterov <oleg@xxxxxxxxxx>
> > On 03/05, Hillf Danton wrote:
> > > See the loop in  ___wait_event(),
> > >
> > > 	for (;;) {
> > > 		prepare_to_wait_event();
> > >
> > > 		// flip
> > > 		if (condition)
> > > 			break;
> > >
> > > 		schedule();
> > > 	}
> > >
> > > After wakeup, waiter will sleep again if condition flips false on the waker
> > > side before waiter checks condition, even if condition is atomic, no?
> >
> > Yes, but in this case pipe_full() == true is correct, this writer can
> > safely sleep.
> >
> No, because no reader is woken up before sleep to make pipe not full.

Why the reader should be woken before this writer sleeps? Why the reader
should be woken at all in this case (when pipe is full again) ?

We certainly can't understand each other.

Could your picture the exact scenario/sequence which can hang?

Oleg.





[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