All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: xiaoguang.wang@linux.alibaba.com, io-uring <io-uring@vger.kernel.org>
Subject: Re: [PATCH 5.10 1/5] io_uring: always let io_iopoll_complete() complete polled io.
Date: Tue, 8 Dec 2020 19:12:15 +0000	[thread overview]
Message-ID: <d9f677a4-1ac0-0e64-5c2a-497cac9dc8e5@gmail.com> (raw)
In-Reply-To: <10e20bd3-b08f-98b8-f857-8b9a75a511dd@kernel.dk>

On 07/12/2020 16:28, Jens Axboe wrote:
> On Sun, Dec 6, 2020 at 3:26 PM Pavel Begunkov <asml.silence@gmail.com> wrote:
>> From: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
>>
>> The reason is that once we got a non EAGAIN error in io_wq_submit_work(),
>> we'll complete req by calling io_req_complete(), which will hold completion_lock
>> to call io_commit_cqring(), but for polled io, io_iopoll_complete() won't
>> hold completion_lock to call io_commit_cqring(), then there maybe concurrent
>> access to ctx->defer_list, double free may happen.
>>
>> To fix this bug, we always let io_iopoll_complete() complete polled io.
> 
> This patch is causing hangs with iopoll testing, if you end up getting
> -EAGAIN on request submission. I've dropped it.

I fail to understand without debugging how does it happen, especially since
it shouldn't even get out of the while in io_wq_submit_work(). Is that
something obvious I've missed?

> 
> Reproducible with test/iopoll /dev/somedevice
> 
> where somedevice has a low queue depth and hits request starvation
> during the test.
> 

-- 
Pavel Begunkov

  reply	other threads:[~2020-12-08 20:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-06 22:22 [PATCH 5.10 0/5] iopoll fixes Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 1/5] io_uring: always let io_iopoll_complete() complete polled io Pavel Begunkov
2020-12-07 16:28   ` Jens Axboe
2020-12-08 19:12     ` Pavel Begunkov [this message]
2020-12-08 19:17       ` Jens Axboe
2020-12-08 19:24         ` Pavel Begunkov
2020-12-08 21:10           ` Jens Axboe
2020-12-09 20:17             ` Pavel Begunkov
2020-12-10 17:38               ` Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 2/5] io_uring: fix racy IOPOLL completions Pavel Begunkov
2020-12-07 18:31   ` Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 3/5] io_uring: fix racy IOPOLL flush overflow Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 4/5] io_uring: fix io_cqring_events()'s noflush Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 5/5] io_uring: fix mis-seting personality's creds Pavel Begunkov
2020-12-07 15:05 ` [PATCH 5.10 0/5] iopoll fixes Jens Axboe
2020-12-07 15:24   ` Pavel Begunkov
2020-12-07 15:28     ` Jens Axboe

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=d9f677a4-1ac0-0e64-5c2a-497cac9dc8e5@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=xiaoguang.wang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.