Linux io-uring development
 help / color / mirror / Atom feed
From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Xiaobing Li <xiaobing.li@samsung.com>
Cc: axboe@kernel.dk,  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: Wed, 08 Nov 2023 11:23:13 -0500	[thread overview]
Message-ID: <877cmsb4em.fsf@> (raw)
In-Reply-To: <20231108080732.15587-1-xiaobing.li@samsung.com> (Xiaobing Li's message of "Wed, 8 Nov 2023 16:07:32 +0800")

Xiaobing Li <xiaobing.li@samsung.com> 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
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@ \
    --to=krisman@suse.de \
    --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 \
    --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