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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZH4p8tqFc57_OYoH@slm.duckdns.org>
Date:   Mon, 5 Jun 2023 08:31:14 -1000
From:   Tejun Heo <tj@...nel.org>
To:     chengming.zhou@...ux.dev
Cc:     axboe@...nel.dk, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Chengming Zhou <zhouchengming@...edance.com>
Subject: Re: [PATCH] blk-mq: fix incorrect rq start_time_ns and alloc_time_ns
 after throttled

Hello,

On Thu, Jun 01, 2023 at 01:39:19PM +0800, chengming.zhou@...ux.dev wrote:
> From: Chengming Zhou <zhouchengming@...edance.com>
> 
> iocost rely on rq start_time_ns and alloc_time_ns to tell the saturation
> state of the block device.
> 
> If any qos ->throttle() end up blocking, the cached rq start_time_ns and
> alloc_time_ns will include its throtted time, which can confuse its user.

I don't follow. rq_qos_throttle() happens before a request is allocated, so
whether ->throttle() blocks or not doesn't affect alloc_time_ns or
start_time_ns.

> This patch add nr_flush counter in blk_plug, so we can tell if the task
> has throttled in any qos ->throttle(), in which case we need to correct
> the rq start_time_ns and alloc_time_ns.
> 
> Another solution may be make rq_qos_throttle() return bool to indicate
> if it has throttled in any qos ->throttle(). But this need more changes.
> 
> Signed-off-by: Chengming Zhou <zhouchengming@...edance.com>

Depending on the flush behavior and adjusting alloc_time_ns seems fragile to
me and will likely confuse other users of alloc_time_ns too.

Maybe I'm misunderstanding the problem you're describing. Can you give a
concrete example of how the current code would misbehave?

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ