From: Pavel Begunkov <asml.silence@gmail.com>
To: Hao Xu <haoxu@linux.alibaba.com>, Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org, Joseph Qi <joseph.qi@linux.alibaba.com>
Subject: Re: [PATCH 2/2] io_uring: don't hold uring_lock when calling io_run_task_work*
Date: Sun, 7 Feb 2021 17:16:34 +0000 [thread overview]
Message-ID: <433825b4-8330-b448-eeeb-4582c5b25159@gmail.com> (raw)
In-Reply-To: <62fc0e30-47bd-71d2-29e3-c2824bf78725@linux.alibaba.com>
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
next prev parent reply other threads:[~2021-02-07 17:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 14:57 [PATCH 0/2] fix deadlock in __io_req_task_submit() Hao Xu
2021-02-03 14:57 ` [PATCH 1/2] io_uring: add uring_lock as an argument to io_sqe_files_unregister() Hao Xu
2021-02-03 16:33 ` Pavel Begunkov
2021-02-04 3:34 ` Hao Xu
2021-02-04 11:11 ` Pavel Begunkov
2021-02-04 14:49 ` Jens Axboe
2021-02-03 14:57 ` [PATCH 2/2] io_uring: don't hold uring_lock when calling io_run_task_work* Hao Xu
2021-02-03 16:35 ` Pavel Begunkov
2021-02-03 16:45 ` Pavel Begunkov
2021-02-04 3:25 ` Hao Xu
2021-02-04 11:17 ` Pavel Begunkov
2021-02-04 15:26 ` Pavel Begunkov
2021-02-05 9:57 ` Hao Xu
2021-02-05 10:18 ` Pavel Begunkov
2021-02-06 11:34 ` Hao Xu
2021-02-07 17:16 ` Pavel Begunkov [this message]
2021-02-06 16:21 ` Hao Xu
2021-02-11 13:30 ` Hao Xu
2021-02-05 10:03 ` Hao Xu
2021-02-04 11:33 ` Pavel Begunkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=433825b4-8330-b448-eeeb-4582c5b25159@gmail.com \
--to=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=haoxu@linux.alibaba.com \
--cc=io-uring@vger.kernel.org \
--cc=joseph.qi@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.