Re: [PATCH] md: raid0: account for split bio in iostat accounting
From: Yu Kuai <hidden>
Date: 2023-08-10 02:06:19
Hi, 在 2023/08/10 1:16, David Jeffery 写道:
When a bio is split by md raid0, the newly created bio will not be tracked by md for I/O accounting. Only the portion of I/O still assigned to the original bio which was reduced by the split will be accounted for. This results in md iostat data sometimes showing I/O values far below the actual amount of data being sent through md. md_account_bio() needs to be called for all bio generated by the bio split.
After a fix tag:
Fixes: 10764815ff47 ("md: add io accounting for raid0 and raid5")
Reviewed-by: Yu Kuai <redacted>
quoted hunk ↗ jump to hunk
Signed-off-by: David Jeffery <redacted> Tested-by: Laurence Oberman <redacted> --- drivers/md/raid0.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index d1ac73fcd852..1fd559ac8c68 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c@@ -597,8 +597,7 @@ static bool raid0_make_request(struct mddev *mddev, struct bio *bio) bio = split; } - if (bio->bi_pool != &mddev->bio_set) - md_account_bio(mddev, &bio); + md_account_bio(mddev, &bio); orig_sector = sector; zone = find_zone(mddev->private, §or);