mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-06-29 23:43:21 -04:00
md/raid10: enable io accounting
For raid10, we record the start time between split bio and clone bio, and finish the accounting in the final endio. Also introduce start_time in r10bio accordingly. Signed-off-by: Guoqing Jiang <jiangguoqing@kylinos.cn> Signed-off-by: Song Liu <song@kernel.org>
This commit is contained in:
parent
a0159832e5
commit
528bc2cf2f
2 changed files with 7 additions and 0 deletions
|
@ -297,6 +297,8 @@ static void raid_end_bio_io(struct r10bio *r10_bio)
|
||||||
if (!test_bit(R10BIO_Uptodate, &r10_bio->state))
|
if (!test_bit(R10BIO_Uptodate, &r10_bio->state))
|
||||||
bio->bi_status = BLK_STS_IOERR;
|
bio->bi_status = BLK_STS_IOERR;
|
||||||
|
|
||||||
|
if (blk_queue_io_stat(bio->bi_bdev->bd_disk->queue))
|
||||||
|
bio_end_io_acct(bio, r10_bio->start_time);
|
||||||
bio_endio(bio);
|
bio_endio(bio);
|
||||||
/*
|
/*
|
||||||
* Wake up any possible resync thread that waits for the device
|
* Wake up any possible resync thread that waits for the device
|
||||||
|
@ -1184,6 +1186,8 @@ static void raid10_read_request(struct mddev *mddev, struct bio *bio,
|
||||||
}
|
}
|
||||||
slot = r10_bio->read_slot;
|
slot = r10_bio->read_slot;
|
||||||
|
|
||||||
|
if (blk_queue_io_stat(bio->bi_bdev->bd_disk->queue))
|
||||||
|
r10_bio->start_time = bio_start_io_acct(bio);
|
||||||
read_bio = bio_clone_fast(bio, gfp, &mddev->bio_set);
|
read_bio = bio_clone_fast(bio, gfp, &mddev->bio_set);
|
||||||
|
|
||||||
r10_bio->devs[slot].bio = read_bio;
|
r10_bio->devs[slot].bio = read_bio;
|
||||||
|
@ -1483,6 +1487,8 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio,
|
||||||
r10_bio->master_bio = bio;
|
r10_bio->master_bio = bio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blk_queue_io_stat(bio->bi_bdev->bd_disk->queue))
|
||||||
|
r10_bio->start_time = bio_start_io_acct(bio);
|
||||||
atomic_set(&r10_bio->remaining, 1);
|
atomic_set(&r10_bio->remaining, 1);
|
||||||
md_bitmap_startwrite(mddev->bitmap, r10_bio->sector, r10_bio->sectors, 0);
|
md_bitmap_startwrite(mddev->bitmap, r10_bio->sector, r10_bio->sectors, 0);
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,7 @@ struct r10bio {
|
||||||
sector_t sector; /* virtual sector number */
|
sector_t sector; /* virtual sector number */
|
||||||
int sectors;
|
int sectors;
|
||||||
unsigned long state;
|
unsigned long state;
|
||||||
|
unsigned long start_time;
|
||||||
struct mddev *mddev;
|
struct mddev *mddev;
|
||||||
/*
|
/*
|
||||||
* original bio going to /dev/mdx
|
* original bio going to /dev/mdx
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue