From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>,
Hao Xu <[email protected]>
Cc: [email protected], Joseph Qi <[email protected]>
Subject: Re: [PATCH] io_uring: fix possible deadlock in io_uring_poll
Date: Tue, 2 Feb 2021 18:48:42 -0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 2/2/21 5:04 PM, Pavel Begunkov wrote:
> On 02/02/2021 19:52, Hao Xu wrote:
>> This might happen if we do epoll_wait on a uring fd while reading/writing
>> the former epoll fd in a sqe in the former uring instance.
>> So let's don't flush cqring overflow list when we fail to get the uring
>> lock. This leads to less accuracy, but is still ok.
>
> if (io_cqring_events(ctx) || test_bit(0, &ctx->cq_check_overflow))
> mask |= EPOLLIN | EPOLLRDNORM;
>
> Instead of flushing. It'd make sense if we define poll as "there might
> be something, go do your peek/wait with overflow checks". Jens, is that
> documented anywhere?
Nope - I actually think that the approach chosen here is pretty good,
it'll force the app to actually check and hence do what it needs to do.
--
Jens Axboe
next prev parent reply other threads:[~2021-02-03 1:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 19:52 [PATCH] io_uring: fix possible deadlock in io_uring_poll Hao Xu
2021-02-03 0:04 ` Pavel Begunkov
2021-02-03 1:48 ` Jens Axboe [this message]
2021-02-03 16:48 ` Pavel Begunkov
2021-02-04 16:48 ` Pavel Begunkov
2021-02-04 16:54 ` Hao Xu
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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