From: Tejun Heo <tj@kernel.org>
To: chengming.zhou@linux.dev
Cc: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
zhouchengming@bytedance.com
Subject: Re: [PATCH v5] blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq
Date: Mon, 10 Jul 2023 09:42:35 -1000 [thread overview]
Message-ID: <ZKxfK-cWyvkujSR0@slm.duckdns.org> (raw)
In-Reply-To: <20230710105516.2053478-1-chengming.zhou@linux.dev>
On Mon, Jul 10, 2023 at 06:55:16PM +0800, chengming.zhou@linux.dev wrote:
> From: Chengming Zhou <zhouchengming@bytedance.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@bytedance.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
next prev parent reply other threads:[~2023-07-10 19:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 10:55 chengming.zhou
2023-07-10 12:11 ` Christoph Hellwig
2023-07-10 19:42 ` Tejun Heo [this message]
2023-07-10 19:47 ` Jens Axboe
2023-07-13 12:25 ` Chengming Zhou
2023-07-13 17:58 ` Tejun Heo
2023-07-13 18:13 ` Jens Axboe
2023-07-14 11:31 ` Chengming Zhou
2023-07-14 14:43 ` Jens Axboe
2023-07-14 14:49 ` Chengming Zhou
2023-07-13 18:31 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZKxfK-cWyvkujSR0@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=chengming.zhou@linux.dev \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=zhouchengming@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®