From: Christoph Hellwig <hch@lst.de>
To: Tang Yizhou <yizhou.tang@shopee.com>
Cc: axboe@kernel.dk, hch@lst.de, yukuai@fnnas.com,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
Leon Hwang <leon.huangfu@shopee.com>
Subject: Re: [PATCH] block: propagate in_flight to whole disk on partition I/O
Date: Fri, 22 May 2026 14:12:19 +0200 [thread overview]
Message-ID: <20260522121219.GB21338@lst.de> (raw)
In-Reply-To: <20260522113751.171630-1-yizhou.tang@shopee.com>
On Fri, May 22, 2026 at 07:37:51PM +0800, Tang Yizhou wrote:
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -1043,6 +1043,8 @@ unsigned long bdev_start_io_acct(struct block_device *bdev, enum req_op op,
> part_stat_lock();
> update_io_ticks(bdev, start_time, false);
> part_stat_local_inc(bdev, in_flight[op_is_write(op)]);
> + if (bdev_is_partition(bdev))
> + part_stat_local_inc(bdev_whole(bdev), in_flight[op_is_write(op)]);
overly lone line.
> + if (bdev_is_partition(bdev))
> + part_stat_local_dec(bdev_whole(bdev), in_flight[op_is_write(op)]);
Same.
> }
> @@ -1144,6 +1147,9 @@ static inline void blk_account_io_start(struct request *req)
> part_stat_lock();
> update_io_ticks(req->part, jiffies, false);
> part_stat_local_inc(req->part, in_flight[op_is_write(req_op(req))]);
> + if (bdev_is_partition(req->part))
> + part_stat_local_inc(bdev_whole(req->part),
> + in_flight[op_is_write(req_op(req))]);
and tis duplicates the above logic. Mabye factor the common code
into two little helpers?
next prev parent reply other threads:[~2026-05-22 12:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 11:37 [PATCH] block: propagate in_flight to whole disk on partition I/O Tang Yizhou
2026-05-22 12:12 ` Christoph Hellwig [this message]
2026-05-22 12:36 ` Tang Yizhou
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=20260522121219.GB21338@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=leon.huangfu@shopee.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yizhou.tang@shopee.com \
--cc=yukuai@fnnas.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