mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
md: clean up accounting for issued sync IO
It's no longer used and can be removed, also remove the field 'gendisk->sync_io'. Link: https://lore.kernel.org/linux-raid/20250506124903.2540268-10-yukuai1@huaweicloud.com Signed-off-by: Yu Kuai <yukuai3@huawei.com> Reviewed-by: Xiao Ni <xni@redhat.com>
This commit is contained in:
parent
e5797ae703
commit
752d0464b7
5 changed files with 0 additions and 32 deletions
|
@ -717,17 +717,6 @@ static inline int mddev_trylock(struct mddev *mddev)
|
|||
}
|
||||
extern void mddev_unlock(struct mddev *mddev);
|
||||
|
||||
static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors)
|
||||
{
|
||||
if (blk_queue_io_stat(bdev->bd_disk->queue))
|
||||
atomic_add(nr_sectors, &bdev->bd_disk->sync_io);
|
||||
}
|
||||
|
||||
static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors)
|
||||
{
|
||||
md_sync_acct(bio->bi_bdev, nr_sectors);
|
||||
}
|
||||
|
||||
struct md_personality
|
||||
{
|
||||
struct md_submodule_head head;
|
||||
|
|
|
@ -2382,7 +2382,6 @@ static void sync_request_write(struct mddev *mddev, struct r1bio *r1_bio)
|
|||
|
||||
wbio->bi_end_io = end_sync_write;
|
||||
atomic_inc(&r1_bio->remaining);
|
||||
md_sync_acct(conf->mirrors[i].rdev->bdev, bio_sectors(wbio));
|
||||
|
||||
submit_bio_noacct(wbio);
|
||||
}
|
||||
|
@ -3055,7 +3054,6 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
|
|||
bio = r1_bio->bios[i];
|
||||
if (bio->bi_end_io == end_sync_read) {
|
||||
read_targets--;
|
||||
md_sync_acct_bio(bio, nr_sectors);
|
||||
if (read_targets == 1)
|
||||
bio->bi_opf &= ~MD_FAILFAST;
|
||||
submit_bio_noacct(bio);
|
||||
|
@ -3064,7 +3062,6 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr,
|
|||
} else {
|
||||
atomic_set(&r1_bio->remaining, 1);
|
||||
bio = r1_bio->bios[r1_bio->read_disk];
|
||||
md_sync_acct_bio(bio, nr_sectors);
|
||||
if (read_targets == 1)
|
||||
bio->bi_opf &= ~MD_FAILFAST;
|
||||
submit_bio_noacct(bio);
|
||||
|
|
|
@ -2426,7 +2426,6 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio)
|
|||
|
||||
atomic_inc(&conf->mirrors[d].rdev->nr_pending);
|
||||
atomic_inc(&r10_bio->remaining);
|
||||
md_sync_acct(conf->mirrors[d].rdev->bdev, bio_sectors(tbio));
|
||||
|
||||
if (test_bit(FailFast, &conf->mirrors[d].rdev->flags))
|
||||
tbio->bi_opf |= MD_FAILFAST;
|
||||
|
@ -2448,8 +2447,6 @@ static void sync_request_write(struct mddev *mddev, struct r10bio *r10_bio)
|
|||
bio_copy_data(tbio, fbio);
|
||||
d = r10_bio->devs[i].devnum;
|
||||
atomic_inc(&r10_bio->remaining);
|
||||
md_sync_acct(conf->mirrors[d].replacement->bdev,
|
||||
bio_sectors(tbio));
|
||||
submit_bio_noacct(tbio);
|
||||
}
|
||||
|
||||
|
@ -2583,13 +2580,10 @@ static void recovery_request_write(struct mddev *mddev, struct r10bio *r10_bio)
|
|||
d = r10_bio->devs[1].devnum;
|
||||
if (wbio->bi_end_io) {
|
||||
atomic_inc(&conf->mirrors[d].rdev->nr_pending);
|
||||
md_sync_acct(conf->mirrors[d].rdev->bdev, bio_sectors(wbio));
|
||||
submit_bio_noacct(wbio);
|
||||
}
|
||||
if (wbio2) {
|
||||
atomic_inc(&conf->mirrors[d].replacement->nr_pending);
|
||||
md_sync_acct(conf->mirrors[d].replacement->bdev,
|
||||
bio_sectors(wbio2));
|
||||
submit_bio_noacct(wbio2);
|
||||
}
|
||||
}
|
||||
|
@ -3757,7 +3751,6 @@ static sector_t raid10_sync_request(struct mddev *mddev, sector_t sector_nr,
|
|||
r10_bio->sectors = nr_sectors;
|
||||
|
||||
if (bio->bi_end_io == end_sync_read) {
|
||||
md_sync_acct_bio(bio, nr_sectors);
|
||||
bio->bi_status = 0;
|
||||
submit_bio_noacct(bio);
|
||||
}
|
||||
|
@ -4880,7 +4873,6 @@ read_more:
|
|||
r10_bio->sectors = nr_sectors;
|
||||
|
||||
/* Now submit the read */
|
||||
md_sync_acct_bio(read_bio, r10_bio->sectors);
|
||||
atomic_inc(&r10_bio->remaining);
|
||||
read_bio->bi_next = NULL;
|
||||
submit_bio_noacct(read_bio);
|
||||
|
@ -4940,7 +4932,6 @@ static void reshape_request_write(struct mddev *mddev, struct r10bio *r10_bio)
|
|||
continue;
|
||||
|
||||
atomic_inc(&rdev->nr_pending);
|
||||
md_sync_acct_bio(b, r10_bio->sectors);
|
||||
atomic_inc(&r10_bio->remaining);
|
||||
b->bi_next = NULL;
|
||||
submit_bio_noacct(b);
|
||||
|
|
|
@ -1240,10 +1240,6 @@ again:
|
|||
}
|
||||
|
||||
if (rdev) {
|
||||
if (s->syncing || s->expanding || s->expanded
|
||||
|| s->replacing)
|
||||
md_sync_acct(rdev->bdev, RAID5_STRIPE_SECTORS(conf));
|
||||
|
||||
set_bit(STRIPE_IO_STARTED, &sh->state);
|
||||
|
||||
bio_init(bi, rdev->bdev, &dev->vec, 1, op | op_flags);
|
||||
|
@ -1300,10 +1296,6 @@ again:
|
|||
submit_bio_noacct(bi);
|
||||
}
|
||||
if (rrdev) {
|
||||
if (s->syncing || s->expanding || s->expanded
|
||||
|| s->replacing)
|
||||
md_sync_acct(rrdev->bdev, RAID5_STRIPE_SECTORS(conf));
|
||||
|
||||
set_bit(STRIPE_IO_STARTED, &sh->state);
|
||||
|
||||
bio_init(rbi, rrdev->bdev, &dev->rvec, 1, op | op_flags);
|
||||
|
|
|
@ -182,7 +182,6 @@ struct gendisk {
|
|||
struct list_head slave_bdevs;
|
||||
#endif
|
||||
struct timer_rand_state *random;
|
||||
atomic_t sync_io; /* RAID */
|
||||
struct disk_events *ev;
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_ZONED
|
||||
|
|
Loading…
Add table
Reference in a new issue