public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiaobing Li <xiaobing.li@samsung.com>
To: axboe@kernel.dk
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, xiaobing.li@samsung.com
Subject: Re: Re: [PATCH v5] io_uring: Statistics of the true utilization of sq threads.
Date: Fri, 22 Dec 2023 16:35:30 +0800	[thread overview]
Message-ID: <20231222083530.11051-1-xiaobing.li@samsung.com> (raw)
In-Reply-To: <c3995796-8aab-45e1-ad59-d970373a4fab@kernel.dk>

On 12/18/23 15:53, Jens Axboe wrote:
> I think I'm convinced that the effectiveness of the chosen SQPOLL
> settings being exposed is useful, I'm just not sure fdinfo is the right
> place to do it. Is it going to be a problem that these are just
> perpetual stats, with no way to reset them? This means there's no way to
> monitor it for a period of time and get effectiveness for something
> specific, it'll always just count from when the ring was created.
> 
> We could of course have the act of reading the stat also reset it, but
> maybe that'd be a bit odd?
> 
> Alternatively, it could be exported differently, eg as a register opcode
> perhaps.
> 
> Open to suggestions...

I thought carefully about your proposed reset stat, and I think it can be 
achieved by outputting "work_time" and "total_time".
eg:
Output at time t1:
SqMask: 0x3
SqHead: 1168417
SqTail: 1168418
SqWorkTime: t1_work
SqTotalTime: t1_total

Output at time t2:
SqMask: 0x3
SqHead: 1168417
SqTail: 1168418
SqWorkTime: t2_work
SqTotalTime: t2_total

Then we can manually calculate the utilization rate from t1 to t2:
(t2_work - t1_work) / (t2_total - t1_total)

Not sure what you think, but if you think it doesn't work, I'll look into 
other good ways to add the ability to reset.

In addition, on register opcode - generally it is used for resource like
buffers, handles etc.. I am not sure how that can help here. If you have
something in mind, could you please elaborate in more detail?

  reply	other threads:[~2023-12-22  8:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20231218085950epcas5p4171efba84d8c14bf1307aa16c48414ca@epcas5p4.samsung.com>
2023-12-18  8:51 ` [PATCH v5] io_uring: Statistics of the true utilization of sq threads Xiaobing Li
2023-12-18 15:53   ` Jens Axboe
2023-12-22  8:35     ` Xiaobing Li [this message]
2023-12-22 14:31       ` Jens Axboe
2023-12-25  2:36         ` Xiaobing Li

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=20231222083530.11051-1-xiaobing.li@samsung.com \
    --to=xiaobing.li@samsung.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --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 \
    /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