public inbox for [email protected]
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <[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], [email protected]
Subject: Re: [PATCH v2] io_uring: Statistics of the true utilization of sq threads.
Date: Wed, 08 Nov 2023 11:23:13 -0500	[thread overview]
Message-ID: <877cmsb4em.fsf@> (raw)
In-Reply-To: <[email protected]> (Xiaobing Li's message of "Wed, 8 Nov 2023 16:07:32 +0800")

Xiaobing Li <[email protected]> writes:

> diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
> index f04a43044d91..f0b79c533062 100644
> --- a/io_uring/fdinfo.c
> +++ b/io_uring/fdinfo.c
> @@ -213,6 +213,12 @@ __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *f)
>  
>  	}
>  
> +	if (ctx->sq_data) {
> +		seq_printf(m, "PID:\t%d\n", task_pid_nr(ctx->sq_data->thread));

ctx->sq_data and sq_data->thread can become NULL if the queue is being
setup/going away. You need to hold the uring_lock and the
ctx->sq_data->lock to access this.

But task_pid_nr is already published in this file a bit before this
hunk.  Perhaps drop this line and move the two lines below together with
them.

> +		seq_printf(m, "work:\t%lu\n", ctx->sq_data->work);
> +		seq_printf(m, "total:\t%lu\n", ctx->sq_data->total);
> +	}

-- 
Gabriel Krisman Bertazi

  parent reply	other threads:[~2023-11-08 16:23 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
2023-11-08 16:23   ` Gabriel Krisman Bertazi [this message]
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=877cmsb4em.fsf@ \
    [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