From: Breno Leitao <leitao@debian.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Mateusz Guzik <mjguzik@gmail.com>,
Christian Brauner <brauner@kernel.org>,
Jens Axboe <axboe@kernel.dk>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
io-uring@vger.kernel.org, Alexey Gladkov <legion@kernel.org>
Subject: Re: [PATCH 0/1] pipe: only enable the extra wake_up(rd_wait) when epoll is actually used
Date: Mon, 27 Jul 2026 04:06:11 -0700 [thread overview]
Message-ID: <amc4SXBOGmLbfmp3@gmail.com> (raw)
In-Reply-To: <amN8ppPXRiUdiVKM@redhat.com>
On Fri, Jul 24, 2026 at 04:54:30PM +0200, Oleg Nesterov wrote:
> On 07/24, Mateusz Guzik wrote:
> >
> > On Fri, Jul 24, 2026 at 3:58 PM Oleg Nesterov <oleg@redhat.com> wrote:
> > >
> > > This means that io_uring depends on the "nasty semantics" too, io_poll_wake()
> > > path should add the task work which calls io_req_post_cqe() every time the new
> > > data arrives, even if the pipe was not empty.
> > >
> >
> > well io_uring could set the flag as well in that case? it does not
> > inherently mean random select and poll consumers definitely need this.
>
> How? I don't think io_uring can do this. It doesn't even know if the file
> is pipe or not. Only file_operations->poll() does know...
>
> __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) &&
unlikely(!READ_ONCE(pipe->poll_usage)))
WRITE_ONCE(pipe->poll_usage, true);
--breno
next prev parent reply other threads:[~2026-07-27 11:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <amIqfCo25rLtM2U0@redhat.com>
[not found] ` <amIu5WWgTNkdvqIz@redhat.com>
2026-07-24 13:58 ` [PATCH 0/1] pipe: only enable the extra wake_up(rd_wait) when epoll is actually used Oleg Nesterov
2026-07-24 14:43 ` Mateusz Guzik
2026-07-24 14:54 ` Oleg Nesterov
2026-07-27 11:06 ` Breno Leitao [this message]
2026-07-27 11:50 ` Oleg Nesterov
2026-07-25 15:19 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=amc4SXBOGmLbfmp3@gmail.com \
--to=leitao@debian.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=io-uring@vger.kernel.org \
--cc=jack@suse.cz \
--cc=legion@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjguzik@gmail.com \
--cc=oleg@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox