Re: [PATCH] pipe: keep per-write wakeups for EPOLLEXCLUSIVE consumers
From: Oleg Nesterov
Date: Tue Nov 17 2026 - 12:25:54 EST
On 11/17, Linus Torvalds wrote:
>
> On Tue, 17 Nov 2026 at 05:27, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> >
> > However, EPOLLEXCLUSIVE breaks this logic. ep_ptable_queue_proc() does
> > add_wait_queue_exclusive() if EPOLLEXCLUSIVE is set.
>
> Christ, how I hate epoll. It's a pile of stinking shit.
>
> This literally violates THE WHOLE AND ONLY POINT of exclusive waits.
>
> The rule for an exclusive wait is that it *will* act on the wakeup -
> either by consuming the data, or - if it can't consume it all - by
> waking up the next waiter itself.
>
> So it's not that "EPOLLEXCLUSIVE breaks this logic".
>
> The logic is fine. EPOLLEXCLUSIVE is broken beyond words.
Well, I thought so too. That is why initially I replied "we don't care"
to Mani. But then I decided to summarize and add CC's.
So. Do you agree that we can "ignore" this report from Mani for now?
Until we find a user application that already depends on the behaviour
before f1cebdec9739 (the next write() wakes up a reader which sleeps on
->rd_wait for no reason).
Just in case... io_uring/poll.c:__io_queue_proc does the same:
if (poll->events & EPOLLEXCLUSIVE) {
add_wait_queue_exclusive(head, &poll->wait);
} else {
add_wait_queue(head, &poll->wait);
}
Oleg.