Re: [PATCH] pipe: keep per-write wakeups for EPOLLEXCLUSIVE consumers

From: Linus Torvalds

Date: Tue Nov 17 2026 - 12:37:16 EST


On Tue, 17 Nov 2026 at 09:25, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> So. Do you agree that we can "ignore" this report from Mani for now?

I think we can ignore it, but I also have a cunning plan.

Normally, exclusive wait events always go at the tail of the wait
queue. We do that mainly because we want to wake all non-exclusive
ones first, and because it's fair.

But pipes don't *have* non-exclusive waiters (ignoring the splice
case, which waits for space, and if there are readers or writes that
would take the space we don't care).

So what we could do is to just make the pipe code open-code its own
wait event logic, and add its waiters at the head.

Voilà - we never even care about epoll braindamage.

Yes, that makes pipes unfair in that new readers get preference over
old readers, and maybe that's not great. It might affect things like
the make jobserver. I'd expect it would probably improve throughput -
new waiters are hot waiters - but it's most definitely worth
mentioning.

It won't fix the "EPOLL edge triggered braindamage", where old
applications asked for edge triggered things and actually wanted level
triggers. But it should solve *this* issue.

Hmm?

Let me stew on this a bit.

Linus