Re: [PATCH 0/1] pipe: only enable the extra wake_up(rd_wait) when epoll is actually used

From: Oleg Nesterov

Date: Mon Jul 27 2026 - 07:50:34 EST


On 07/27, Breno Leitao wrote:
>
> On Fri, Jul 24, 2026 at 04:54:30PM +0200, Oleg Nesterov wrote:
> >
> > __Perhaps__ pipe_poll() could check something like wait->_key & EPOLLET to
> > detect both epoll/io_uring... Not sure, probably not, I'll try to check later.
>
> I got the impression that pipe_poll() sees EPOLLET in wait->_key for
> io_uring the same as for EPOLLET epoll. Since d59bd748db0a
> ("io_uring/poll: disable level triggered poll").
>
> io_poll_add_prep(), which is called before teh proper iouring command,
> rejects IORING_POLL_ADD_LEVEL, so io_poll_parse_events() always ORs in
> EPOLLET for IORING_OP_POLL_ADD.
>
> The internal apoll path sets EPOLLET unconditionally too
> (io_arm_apoll()), so every io_uring poll arming carries it.
>
> Maybe this would work on the set side?
>
> if ((filp->f_mode & FMODE_READ) && wait &&
> (wait->_key & EPOLLET) &&

This is exactly what I meant and what I did. I am writing the changelog,
will send the patch soon today. Both test-cases I wrote pass, same for
tools/testing/selftests/filesystems/epoll/epoll_wakeup_test.c

Oleg.