Re: [PATCH 2/2] io_uring: don't hold uring_lock when calling io_run_task_work*

Pavel Begunkov
2021-02-07T17:21:38Z

On 06/02/2021 11:34, Hao Xu wrote:
> I saw percpu_ref_is_dying(&ctx->refs) check in sq thread but not
> in io_uring_enter(), so I guess there could be another thread doing
> io_uring_enter() and submiting sqes.

Ok, looks tryget does it in a different fashion than I recalled.

> So we can just put unlock and lock around io_run_task_work_sig()
> to address the issue 2?

io_set_resource_node()
-> percpu_ref_get()

If refs are left dying, it won't be safe for in-parallel enters.
tryget or resurrect

--
Pavel Begunkov