Skip to content

Commit bb7c988

Browse files
author
Ming Lei
committed
md/raid10: fix missing discard IO accounting
JIRA: https://issues.redhat.com/browse/RHEL-106845 commit d05af90 Author: Yu Kuai <yukuai3@huawei.com> Date: Tue Mar 25 09:57:46 2025 +0800 md/raid10: fix missing discard IO accounting md_account_bio() is not called from raid10_handle_discard(), now that we handle bitmap inside md_account_bio(), also fix missing bitmap_startwrite for discard. Test whole disk discard for 20G raid10: Before: Device d/s dMB/s drqm/s %drqm d_await dareq-sz md0 48.00 16.00 0.00 0.00 5.42 341.33 After: Device d/s dMB/s drqm/s %drqm d_await dareq-sz md0 68.00 20462.00 0.00 0.00 2.65 308133.65 Link: https://lore.kernel.org/linux-raid/20250325015746.3195035-1-yukuai1@huaweicloud.com Fixes: 528bc2c ("md/raid10: enable io accounting") Signed-off-by: Yu Kuai <yukuai3@huawei.com> Acked-by: Coly Li <colyli@kernel.org> Signed-off-by: Ming Lei <ming.lei@redhat.com>
1 parent b51e0cd commit bb7c988

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/md/raid10.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,7 @@ static int raid10_handle_discard(struct mddev *mddev, struct bio *bio)
17441744
* The discard bio returns only first r10bio finishes
17451745
*/
17461746
if (first_copy) {
1747+
md_account_bio(mddev, &bio);
17471748
r10_bio->master_bio = bio;
17481749
set_bit(R10BIO_Discard, &r10_bio->state);
17491750
first_copy = false;

0 commit comments

Comments
 (0)