Re: [PATCH 5/5] io_uring: batch completion in prior_task_list

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

 



Hi,

在 2021/12/8 上午5:16, Pavel Begunkov 写道:
On 12/7/21 21:01, Pavel Begunkov wrote:
On 12/7/21 09:39, Hao Xu wrote:
In previous patches, we have already gathered some tw with
io_req_task_complete() as callback in prior_task_list, let's complete
them in batch while we cannot grab uring lock. In this way, we batch
the req_complete_post path.
[...]
+        if (likely(*uring_locked))
+            req->io_task_work.func(req, uring_locked);
+        else
+            __io_req_complete_post(req, req->result, io_put_kbuf(req));

I think there is the same issue as last time, first iteration of tctx_task_work() sets ctx but doesn't get uring_lock. Then you go here, find a request with the
same ctx and end up here with locking.

Maybe something like below on top? Totally untested. We basically always
want *uring_locked != *compl_locked, so we don't even need to to store
both vars.

Thanks, Pavel. I Forgot to think about when req->ctx == ctx, tested the fix here

and it looks good.


Regards,
Hao




[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