public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Pavel Begunkov <[email protected]>, [email protected]
Subject: Re: [PATCH liburing] Fix hang in in io_uring_get_cqe() with iopoll
Date: Sun, 21 Jun 2020 09:23:36 -0600	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <c1c4cd592333959bf2e0a4d2381372f1b40aef7b.1592735406.git.asml.silence@gmail.com>

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?

Also, s/io_adjut_wait_nr/io_adjust_wait_nr for the patch.

-- 
Jens Axboe


  reply	other threads:[~2020-06-21 15:23 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 [this message]
2020-06-21 15:30   ` Pavel Begunkov

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