Re: [PATCH 5.11] io_uring: fix wqe->lock/completion_lock deadlock

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

 



On 27/01/2021 01:52, Joseph Qi wrote:>> Only __io_queue_deferred() calls queue_async_work() while holding
>> ctx->completion_lock, enqueue drained requests via io_req_task_queue()
>> instead.
>>
> We should follow &wqe->lock > &ctx->completion_lock from now on, right?
> I was thinking getting completion_lock first before:(
> 
> Moreover, there are so many locks and no suggested locking order in
> comments, so that it is hard for us to participate in the work.

It's rc5, so that was rather of a "make it fast" kind... I don't like
this ordering, but hopefully the patch doesn't enforce it, and I'd leave
it for 5.11 and prefer to see something else for next releases.

Would be glad to review if take on it. I think it's no good taking a
lock before io_wq_cancel_cb(), but there should be other options. E.g.
split wqe->lock in two.

> 
>> Cc: stable@xxxxxxxxxxxxxxx # 5.9+
>> Reported-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx>
> 
> Tested-by: Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx>

Thanks!

-- 
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