Re: [PATCH v2] io_uring: Statistics of the true utilization of sq threads.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xiaobing Li <xiaobing.li@xxxxxxxxxxx> 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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux