lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 6 Nov 2023 07:55:20 -0700
From:   Jens Axboe <axboe@...nel.dk>
To:     Xiaobing Li <xiaobing.li@...sung.com>, asml.silence@...il.com
Cc:     linux-kernel@...r.kernel.org, io-uring@...r.kernel.org,
        kun.dou@...sung.com, peiwei.li@...sung.com, joshi.k@...sung.com,
        kundan.kumar@...sung.com, wenwen.chen@...sung.com,
        ruyi.zhang@...sung.com
Subject: Re: [PATCH] IO_URING: Statistics of the true utilization of sq
 threads.

On 11/6/23 12:40 AM, Xiaobing Li wrote:
> Since the sq thread has a while(1) structure, during this process, there
> may be a lot of time that is not processing IO but does not exceed the
> timeout period, therefore, the sqpoll thread will keep running and will
> keep occupying the CPU. Obviously, the CPU is wasted at this time;Our
> goal is to count the part of the time that the sqpoll thread actually
> processes IO, so as to reflect the part of the CPU it uses to process
> IO, which can be used to help improve the actual utilization of the CPU
> in the future.
> 
> Signed-off-by: Xiaobing Li <xiaobing.li@...sung.com>
> ---
>  io_uring/sqpoll.c | 8 ++++++++
>  io_uring/sqpoll.h | 2 ++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c
> index bd6c2c7959a5..27b01ad42678 100644
> --- a/io_uring/sqpoll.c
> +++ b/io_uring/sqpoll.c
> @@ -224,6 +224,7 @@ static int io_sq_thread(void *data)
>  	struct io_ring_ctx *ctx;
>  	unsigned long timeout = 0;
>  	char buf[TASK_COMM_LEN];
> +	unsigned long long start, begin, end;
>  	DEFINE_WAIT(wait);

These can just be unsigned long, that's the size of jiffies on any
platform. Ditto for struct io_sq_data.

And while this looks fine, nothing is using this accounting. For this to
be an acceptable patch, surely the value needs to be used somehow or at
least you should be able to query it?

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ