public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Xiaobing Li <[email protected]>, [email protected]
Cc: [email protected], [email protected],
	[email protected], [email protected], [email protected],
	[email protected], [email protected],
	[email protected], [email protected],
	[email protected]
Subject: Re: [PATCH v5] io_uring: Statistics of the true utilization of sq threads.
Date: Mon, 18 Dec 2023 08:53:24 -0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 12/18/23 1:51 AM, Xiaobing Li wrote:
> The running time of the sq thread and the actual IO processing time are
> counted, and the proportion of time actually used to process IO is
> output as a percentage.
> 
> Variable description:
> "work_time" in the code represents the sum of the jiffies of the sq
> thread actually processing IO, that is, how many milliseconds it
> actually takes to process IO. "total_time" represents the total time
> that the sq thread has elapsed from the beginning of the loop to the
> current time point, that is, how many milliseconds it has spent in
> total.
> The output "SqBusy" represents the percentage of time utilization that
> the sq thread actually uses to process IO.> 
> The test results are as follows:
> Every 0.5s: cat /proc/23112/fdinfo/6 | grep Sq
> SqMask: 0x3
> SqHead: 1168417
> SqTail: 1168418
> CachedSqHead:   1168418
> SqThread:       23112
> SqThreadCpu:    55
> SqBusy: 97%

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...

-- 
Jens Axboe


  reply	other threads:[~2023-12-18 15:53 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 [this message]
     [not found]     ` <CGME20231222084334epcas5p10badfe3c82a6b8355c03f8d0aa192892@epcas5p1.samsung.com>
2023-12-22  8:35       ` Xiaobing Li
2023-12-22 14:31         ` Jens Axboe
     [not found]           ` <CGME20231225024445epcas5p1d0525b9595544d8fe7b8ea60f5741b58@epcas5p1.samsung.com>
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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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