From: Jens Axboe <axboe@kernel.dk>
To: Xiaobing Li <xiaobing.li@samsung.com>
Cc: asml.silence@gmail.com, linux-kernel@vger.kernel.org,
io-uring@vger.kernel.org, kun.dou@samsung.com,
peiwei.li@samsung.com, joshi.k@samsung.com,
kundan.kumar@samsung.com, wenwen.chen@samsung.com,
ruyi.zhang@samsung.com
Subject: Re: [PATCH v2] io_uring: Statistics of the true utilization of sq threads.
Date: Mon, 13 Nov 2023 09:38:19 -0700 [thread overview]
Message-ID: <93c6f293-7aa5-4e12-b238-f369d53ab28e@kernel.dk> (raw)
In-Reply-To: <20231113031040.1391334-1-xiaobing.li@samsung.com>
On 11/12/23 8:10 PM, Xiaobing Li wrote:
> After careful consideration and testing, I don't think getting the
> uring_lock is possible here, for the following reasons:
> Due to lock competition, ctx->uring_lock and sq->lock are usually not
> available here. The best proof is that the values of SqThread and
> SqThreadCpu always output -1. In this case, it is impossible to obtain
> the required work_time and total_time values.
> In fact, it should be feasible to obtain work_time and total_time by
> judging that ctx->sq_data is not NULL, because if the sq thread exits,
> the action of reading data will also stop, and the possibility of a null
> pointer reference is very low.
We have that problem right now, in the current tree. And agree it's not
the best. sq_data should be fine under the (ctx) lock, it's just the
thread that may go away. Maybe we just cache the cpu/pid of it when we
create it, seems better than needing to query it. And for the other
stats, should be fine in ctx->sq_data.
--
Jens Axboe
next prev parent reply other threads:[~2023-11-13 16:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20231108081516epcas5p442a11004e3b4e6339972fd6da4c6692b@epcas5p4.samsung.com>
2023-11-08 8:07 ` [PATCH v2] io_uring: Statistics of the true utilization of sq threads Xiaobing Li
2023-11-08 15:26 ` Jens Axboe
2023-11-13 3:10 ` Xiaobing Li
2023-11-13 16:38 ` Jens Axboe [this message]
2023-11-08 16:23 ` Gabriel Krisman Bertazi
2023-11-09 16:14 ` 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=93c6f293-7aa5-4e12-b238-f369d53ab28e@kernel.dk \
--to=axboe@kernel.dk \
--cc=asml.silence@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=joshi.k@samsung.com \
--cc=kun.dou@samsung.com \
--cc=kundan.kumar@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peiwei.li@samsung.com \
--cc=ruyi.zhang@samsung.com \
--cc=wenwen.chen@samsung.com \
--cc=xiaobing.li@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox