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