lkml.org 
[lkml]   [2023]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@linux.dev wrote:
> From: Chengming Zhou <zhouchengming@bytedance.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@bytedance.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

\
 
 \ /
  Last update: 2023-06-05 20:33    [W:1.311 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site