[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZKxfK-cWyvkujSR0@slm.duckdns.org>
Date: Mon, 10 Jul 2023 09:42:35 -1000
From: Tejun Heo <tj@...nel.org>
To: chengming.zhou@...ux.dev
Cc: axboe@...nel.dk, hch@....de, ming.lei@...hat.com,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
zhouchengming@...edance.com
Subject: Re: [PATCH v5] blk-mq: fix start_time_ns and alloc_time_ns for
pre-allocated rq
On Mon, Jul 10, 2023 at 06:55:16PM +0800, chengming.zhou@...ux.dev wrote:
> From: Chengming Zhou <zhouchengming@...edance.com>
>
> The iocost rely on rq start_time_ns and alloc_time_ns to tell saturation
> state of the block device. Most of the time request is allocated after
> rq_qos_throttle() and its alloc_time_ns or start_time_ns won't be affected.
>
> But for plug batched allocation introduced by the commit 47c122e35d7e
> ("block: pre-allocate requests if plug is started and is a batch"), we can
> rq_qos_throttle() after the allocation of the request. This is what the
> blk_mq_get_cached_request() does.
>
> In this case, the cached request alloc_time_ns or start_time_ns is much
> ahead if blocked in any qos ->throttle().
>
> Fix it by setting alloc_time_ns and start_time_ns to now when the allocated
> request is actually used.
>
> Signed-off-by: Chengming Zhou <zhouchengming@...edance.com>
Acked-by: Tejun Heo <tj@...nel.org>
Thanks.
--
tejun
Powered by blists - more mailing lists