Re: [RFC PATCH v2 1/1] pipe: only enable the extra wake_up(rd_wait) for edge-triggered consumers

From: Oleg Nesterov

Date: Wed Jul 29 2026 - 13:31:12 EST


Pavel, thanks for taking the look!

But let me ask a couple of questions to ensure I really understand you.

On 07/29, Pavel Begunkov wrote:
>
> On 7/27/26 13:28, Oleg Nesterov wrote:
> > pipe_poll() unconditionally sets poll_usage on the first call, forcing
> > anon_pipe_write() to wake up readers on every write even if the pipe was
> > not empty. But this is only needed for edge-triggered consumers: epoll
> > with EPOLLET and io_uring without (unsupported) IORING_POLL_ADD_LEVEL.
> > poll() and select() users pay for it for no reason.
>
> Sounds good, especially with prep patches you mentioned.

By prep patches you mean the

With or without this patch we need to update the comments to document
that io_uring depends on ->pipe_usage too. And probably rename it to
(say) ->et_poll.

note in "v2 0/1" ?

If yes, I'll send this change as "v3 1/2", rediff this patch on top of it,
and make it "v3 2/2".

> The only note your problems are caused by IORING_OP_POLL_ADD, which
> is not that important comparing to other polled io_uring requests,
> and they also set EPOLLET while should be fine with level. Not
> asking to change anything, io_uring should just stop setting EPOLLET
> for them. And IIUC poll callback implementations don't care about
> EPOLLET, at least before this patch.

Sorry, I am a bit confused, could you add more details?

In particular, I don't understand the "IUC poll callback implementations
don't care about EPOLLET, at least before this patch" part.

Although it seems you agree that this patch should not break (change the
current behaviour of) io_uring, and right now this is my only concern.

Can you ack/nack my understanding?

Thanks!

Oleg.