io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
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: <8e9d1846-2bb0-4827-c527-9834c9101775@gmail.com> (raw)
In-Reply-To: <b7e1f0c9-8650-d45f-5821-6c4984bec320@kernel.dk>

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

      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 \
    --in-reply-to=8e9d1846-2bb0-4827-c527-9834c9101775@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).