From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: Re: [PATCH liburing] Fix hang in in io_uring_get_cqe() with iopoll
Date: Sun, 21 Jun 2020 18:30:25 +0300 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 21/06/2020 18:23, Jens Axboe wrote:
> On 6/21/20 4:30 AM, Pavel Begunkov wrote:
>> Because of need_resched() check, io_uring_enter() -> io_iopoll_check()
>> can return 0 even if @min_complete wasn't satisfied. If that's the
>> case, __io_uring_get_cqe() sets submit=0 and wait_nr=0, disabling
>> setting IORING_ENTER_GETEVENTS as well. So, it goes crazy calling
>> io_uring_enter() in a loop, not actually submitting nor polling.
>>
>> Set @wait_nr based on actual number of CQEs ready.
>> BTW, atomic_load_acquire() in io_uring_cq_ready() can be replaced
>> with a relaxed one for this particular place.
>
> Can you preface this with an addition of __io_uring_cqe_ready() that
> doesn't include the load acquire?
Sure
> Also, s/io_adjut_wait_nr/io_adjust_wait_nr for the patch.
Ouch, a typo
--
Pavel Begunkov
prev parent reply other threads:[~2020-06-21 15:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-21 10:30 [PATCH liburing] Fix hang in in io_uring_get_cqe() with iopoll Pavel Begunkov
2020-06-21 15:23 ` Jens Axboe
2020-06-21 15:30 ` Pavel Begunkov [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 \
[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