Re: [PATCH 5.10 1/5] io_uring: always let io_iopoll_complete() complete polled io.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/12/2020 16:28, Jens Axboe wrote:
> On Sun, Dec 6, 2020 at 3:26 PM Pavel Begunkov <asml.silence@xxxxxxxxx> wrote:
>> From: Xiaoguang Wang <xiaoguang.wang@xxxxxxxxxxxxxxxxx>
>>
>> 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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux