From: Hao Xu <haoxu@linux.alibaba.com>
To: Pavel Begunkov <asml.silence@gmail.com>, Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: Re: [PATCH] io_uring: fix possible deadlock in io_uring_poll
Date: Fri, 5 Feb 2021 00:54:27 +0800 [thread overview]
Message-ID: <8a4ff8ae-8c92-b4fc-7f95-6724be1f92e9@linux.alibaba.com> (raw)
In-Reply-To: <0c7cfa8b-5c32-7b00-e312-936df68553a2@gmail.com>
在 2021/2/5 上午12:48, Pavel Begunkov 写道:
> On 03/02/2021 01:48, Jens Axboe wrote:
>> 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.
>
> Ok, seems we agree on that.
>
> Hao, can you send an updated patch?
>
Sure, will send v2 soon.
prev parent reply other threads:[~2021-02-04 16:55 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
2021-02-03 16:48 ` Pavel Begunkov
2021-02-04 16:48 ` Pavel Begunkov
2021-02-04 16:54 ` Hao Xu [this message]
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=8a4ff8ae-8c92-b4fc-7f95-6724be1f92e9@linux.alibaba.com \
--to=haoxu@linux.alibaba.com \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=joseph.qi@linux.alibaba.com \
/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