From: Pavel Begunkov <asml.silence@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>, Breno Leitao <leitao@debian.org>,
Christian Brauner <brauner@kernel.org>,
Mateusz Guzik <mjguzik@gmail.com>, Jens Axboe <axboe@kernel.dk>
Cc: 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: Wed, 29 Jul 2026 12:26:25 +0100 [thread overview]
Message-ID: <4877b1e6-f4d2-4522-b318-29b49c66b117@gmail.com> (raw)
In-Reply-To: <amTT60nc1QNIyPfL@redhat.com>
On 7/25/26 16:19, Oleg Nesterov wrote:
> On 07/24, Oleg Nesterov wrote:
>>
>> On 07/23, Oleg Nesterov wrote:
>>>
>>> OK, sashiko has some concerns
>>>
>>> https://sashiko.dev/#/patchset/amIqmbbZx3NlzUsX%40redhat.com
>>
>> Let me quote:
>>
>> Does skipping this wakeup for non-epoll consumers break io_uring?
>>
>> Applications polling pipes via io_uring do not attach an eventpoll context,
>> so pipe->epoll_usage will be false. If a writer writes to an empty pipe,
>> io_uring receives the wakeup.
>>
>> If the writer then writes a second chunk before the first is drained,
>> anon_pipe_write() observes was_empty == false and
>> pipe_get_epoll_usage() == false, skipping the waitqueue wakeup.
>>
>> Could this cause io_uring to miss events and hang permanently, waiting
>> for a CQE that will never be emitted for the new data?
>>
>> and I am starting to think sashiko is right (damn as always ;) and this
>> patch does affect/break io_uring.
>>
>> Jens, could you confirm? If yes, we need to update the comments in pipe.c
>> (I've attached 1/1 at the end, so that you can see what this patch does)
> ...
>> It seems that IORING_OP_POLL_ADD / IORING_POLL_ADD_MULTI is edge-triggered
>> by default! Like EPOLL_CTL_ADD / EPOLLET.
>
> Yes, sashiko is right. With some help from AI I wrote the simple test-case
https://github.com/axboe/liburing/blob/master/man/io_uring_enter.2#L400
Seems like it's even documented, which is a shame because I deem
IORING_OP_POLL_ADD + IORING_POLL_ADD_MULTI to be a half broken API that
should be deprecated after investigating lxc problems with it some years
back. Makes me wonder, likely it wouldn't even break anything if shifts
from strict edge definition for pipes. It's a stream, and the user doesn't
generally know the number of bytes sitting there.
--
Pavel Begunkov
next prev parent reply other threads:[~2026-07-29 11:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 14:51 Oleg Nesterov
2026-07-23 14:52 ` [PATCH 1/1] " Oleg Nesterov
2026-07-23 16:41 ` Mateusz Guzik
2026-07-23 15:10 ` [PATCH 0/1] " Oleg Nesterov
2026-07-24 13:58 ` Oleg Nesterov
2026-07-24 14:43 ` Mateusz Guzik
2026-07-24 14:54 ` Oleg Nesterov
2026-07-27 11:06 ` Breno Leitao
2026-07-27 11:50 ` Oleg Nesterov
2026-07-25 15:19 ` Oleg Nesterov
2026-07-29 11:26 ` Pavel Begunkov [this message]
2026-07-29 11:45 ` 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=4877b1e6-f4d2-4522-b318-29b49c66b117@gmail.com \
--to=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=io-uring@vger.kernel.org \
--cc=jack@suse.cz \
--cc=legion@kernel.org \
--cc=leitao@debian.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
all inboxes | Powered by JetHome®