提交 77d9bc78 编写于 作者: Y Yu Kuai 提交者: Jialin Zhang

raid1, raid10: switch to precise io accounting

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6L586
CVE: NA

--------------------------------

'ios' and 'sectors' is counted in bio_start_io_acct() while io is
started insted of io is done. Hence switch to precise io accounting to
count them when io is done.
Signed-off-by: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NHou Tao <houtao1@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 313f2905
......@@ -301,7 +301,7 @@ static void call_bio_endio(struct r1bio *r1_bio)
bio->bi_status = BLK_STS_IOERR;
if (blk_queue_io_stat(bio->bi_disk->queue))
bio_end_io_acct(bio, r1_bio->start_time);
bio_end_precise_io_acct(bio, r1_bio->start_time);
bio_endio(bio);
}
......@@ -1295,7 +1295,7 @@ static void raid1_read_request(struct mddev *mddev, struct bio *bio,
r1_bio->read_disk = rdisk;
if (!r1bio_existed && blk_queue_io_stat(bio->bi_disk->queue))
r1_bio->start_time = bio_start_io_acct(bio);
r1_bio->start_time = bio_start_precise_io_acct(bio);
read_bio = bio_clone_fast(bio, gfp, &mddev->bio_set);
......@@ -1487,7 +1487,7 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
}
if (blk_queue_io_stat(bio->bi_disk->queue))
r1_bio->start_time = bio_start_io_acct(bio);
r1_bio->start_time = bio_start_precise_io_acct(bio);
atomic_set(&r1_bio->remaining, 1);
atomic_set(&r1_bio->behind_remaining, 0);
......
......@@ -298,7 +298,7 @@ static void raid_end_bio_io(struct r10bio *r10_bio)
bio->bi_status = BLK_STS_IOERR;
if (blk_queue_io_stat(bio->bi_disk->queue))
bio_end_io_acct(bio, r10_bio->start_time);
bio_end_precise_io_acct(bio, r10_bio->start_time);
bio_endio(bio);
/*
* Wake up any possible resync thread that waits for the device
......@@ -1188,7 +1188,7 @@ static void raid10_read_request(struct mddev *mddev, struct bio *bio,
slot = r10_bio->read_slot;
if (!handle_error && blk_queue_io_stat(bio->bi_disk->queue))
r10_bio->start_time = bio_start_io_acct(bio);
r10_bio->start_time = bio_start_precise_io_acct(bio);
read_bio = bio_clone_fast(bio, gfp, &mddev->bio_set);
r10_bio->devs[slot].bio = read_bio;
......@@ -1473,7 +1473,7 @@ static void raid10_write_request(struct mddev *mddev, struct bio *bio,
}
if (blk_queue_io_stat(bio->bi_disk->queue))
r10_bio->start_time = bio_start_io_acct(bio);
r10_bio->start_time = bio_start_precise_io_acct(bio);
atomic_set(&r10_bio->remaining, 1);
md_bitmap_startwrite(mddev->bitmap, r10_bio->sector, r10_bio->sectors, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册