public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: Xiaobing Li <[email protected]>
Cc: [email protected], [email protected],
	[email protected], [email protected],
	[email protected], [email protected],
	[email protected], [email protected],
	[email protected]
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: <[email protected]> (raw)
In-Reply-To: <[email protected]>

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


  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
     [not found]     ` <CGME20231113031827epcas5p2e6e858292a3cd4b9e03b4615d972b22d@epcas5p2.samsung.com>
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 \
    [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