From: Yu Kuai <yukuai@kernel.org>
To: Tang Yizhou <yizhou.tang@shopee.com>,
axboe@kernel.dk, hch@lst.de, jack@suse.cz
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
tangyeechou@gmail.com
Subject: Re: [PATCH 1/3] blk-wbt: Optimize wbt_done() for non-throttled writes
Date: Sat, 26 Jul 2025 02:07:33 +0800 [thread overview]
Message-ID: <6375ee42-a9c3-4cb9-b14e-856565dd8525@kernel.org> (raw)
In-Reply-To: <20250724083001.362882-2-yizhou.tang@shopee.com>
Hi,
在 2025/7/24 16:29, Tang Yizhou 写道:
> From: Tang Yizhou <yizhou.tang@shopee.com>
>
> In the current implementation, the sync_cookie and last_cookie members of
> struct rq_wb are used only by read requests and not by non-throttled write
> requests. Based on this, we can optimize wbt_done() by removing one if
> condition check for non-throttled write requests.
>
> Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com>
> ---
> block/blk-wbt.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/block/blk-wbt.c b/block/blk-wbt.c
> index a50d4cd55f41..30886d44f6cd 100644
> --- a/block/blk-wbt.c
> +++ b/block/blk-wbt.c
> @@ -248,13 +248,14 @@ static void wbt_done(struct rq_qos *rqos, struct request *rq)
> struct rq_wb *rwb = RQWB(rqos);
>
> if (!wbt_is_tracked(rq)) {
> - if (rwb->sync_cookie == rq) {
> - rwb->sync_issue = 0;
> - rwb->sync_cookie = NULL;
> - }
> + if (wbt_is_read(rq)) {
> + if (rwb->sync_cookie == rq) {
> + rwb->sync_issue = 0;
> + rwb->sync_cookie = NULL;
> + }
>
> - if (wbt_is_read(rq))
> wb_timestamp(rwb, &rwb->last_comp);
> + }
> } else {
> WARN_ON_ONCE(rq == rwb->sync_cookie);
> __wbt_done(rqos, wbt_flags(rq));
At lease this is correct logically.
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
next prev parent reply other threads:[~2025-07-25 18:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-24 8:29 [PATCH 0/3] Optimize wbt and update its comments and doc Tang Yizhou
2025-07-24 8:29 ` [PATCH 1/3] blk-wbt: Optimize wbt_done() for non-throttled writes Tang Yizhou
2025-07-25 15:56 ` Jan Kara
2025-07-25 18:07 ` Yu Kuai [this message]
2025-07-24 8:30 ` [PATCH 2/3] blk-wbt: Eliminate ambiguity in the comments of struct rq_wb Tang Yizhou
2025-07-25 15:41 ` Jan Kara
2025-07-25 18:13 ` Yu Kuai
2025-07-24 8:30 ` [PATCH 3/3] blk-wbt: doc: Update the doc of the wbt_lat_usec interface Tang Yizhou
2025-07-25 15:49 ` Jan Kara
2025-07-25 18:16 ` Yu Kuai
2025-07-27 16:35 ` Yizhou Tang
2025-07-27 16:35 ` Yizhou Tang
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=6375ee42-a9c3-4cb9-b14e-856565dd8525@kernel.org \
--to=yukuai@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tangyeechou@gmail.com \
--cc=yizhou.tang@shopee.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®