Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'md-6.16-20250513' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux into for-6.16/block

Pull MD changes from Yu Kuai:

- Fix that normal IO can be starved by sync IO, found by mkfs on newly
created large raid5, with some clean up patches for bdev inflight
counters.

* tag 'md-6.16-20250513' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux:
md: clean up accounting for issued sync IO
md: fix is_mddev_idle()
md: add a new api sync_io_depth
md: record dm-raid gendisk in mddev
block: export API to get the number of bdev inflight IO
block: clean up blk_mq_in_flight_rw()
block: WARN if bdev inflight counter is negative
block: reuse part_in_flight_rw for part_in_flight
blk-mq: remove blk_mq_in_flight()

+197 -148
+1 -1
block/blk-core.c
··· 1018 1018 stamp = READ_ONCE(part->bd_stamp); 1019 1019 if (unlikely(time_after(now, stamp)) && 1020 1020 likely(try_cmpxchg(&part->bd_stamp, &stamp, now)) && 1021 - (end || part_in_flight(part))) 1021 + (end || bdev_count_inflight(part))) 1022 1022 __part_stat_add(part, io_ticks, now - stamp); 1023 1023 1024 1024 if (bdev_is_partition(part)) {
+6 -16
block/blk-mq.c
··· 89 89 unsigned int inflight[2]; 90 90 }; 91 91 92 - static bool blk_mq_check_inflight(struct request *rq, void *priv) 92 + static bool blk_mq_check_in_driver(struct request *rq, void *priv) 93 93 { 94 94 struct mq_inflight *mi = priv; 95 95 ··· 101 101 return true; 102 102 } 103 103 104 - unsigned int blk_mq_in_flight(struct request_queue *q, 105 - struct block_device *part) 104 + void blk_mq_in_driver_rw(struct block_device *part, unsigned int inflight[2]) 106 105 { 107 106 struct mq_inflight mi = { .part = part }; 108 107 109 - blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi); 110 - 111 - return mi.inflight[0] + mi.inflight[1]; 112 - } 113 - 114 - void blk_mq_in_flight_rw(struct request_queue *q, struct block_device *part, 115 - unsigned int inflight[2]) 116 - { 117 - struct mq_inflight mi = { .part = part }; 118 - 119 - blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi); 120 - inflight[0] = mi.inflight[0]; 121 - inflight[1] = mi.inflight[1]; 108 + blk_mq_queue_tag_busy_iter(bdev_get_queue(part), blk_mq_check_in_driver, 109 + &mi); 110 + inflight[READ] = mi.inflight[READ]; 111 + inflight[WRITE] = mi.inflight[WRITE]; 122 112 } 123 113 124 114 #ifdef CONFIG_LOCKDEP
+1 -4
block/blk-mq.h
··· 246 246 return hctx->nr_ctx && hctx->tags; 247 247 } 248 248 249 - unsigned int blk_mq_in_flight(struct request_queue *q, 250 - struct block_device *part); 251 - void blk_mq_in_flight_rw(struct request_queue *q, struct block_device *part, 252 - unsigned int inflight[2]); 249 + void blk_mq_in_driver_rw(struct block_device *part, unsigned int inflight[2]); 253 250 254 251 static inline void blk_mq_put_dispatch_budget(struct request_queue *q, 255 252 int budget_token)
-1
block/blk.h
··· 419 419 int blk_dev_init(void); 420 420 421 421 void update_io_ticks(struct block_device *part, unsigned long now, bool end); 422 - unsigned int part_in_flight(struct block_device *part); 423 422 424 423 static inline void req_set_nomerge(struct request_queue *q, struct request *req) 425 424 {
+45 -34
block/genhd.c
··· 125 125 } 126 126 } 127 127 128 - unsigned int part_in_flight(struct block_device *part) 129 - { 130 - unsigned int inflight = 0; 131 - int cpu; 132 - 133 - for_each_possible_cpu(cpu) { 134 - inflight += part_stat_local_read_cpu(part, in_flight[0], cpu) + 135 - part_stat_local_read_cpu(part, in_flight[1], cpu); 136 - } 137 - if ((int)inflight < 0) 138 - inflight = 0; 139 - 140 - return inflight; 141 - } 142 - 143 - static void part_in_flight_rw(struct block_device *part, 144 - unsigned int inflight[2]) 128 + static void bdev_count_inflight_rw(struct block_device *part, 129 + unsigned int inflight[2], bool mq_driver) 145 130 { 146 131 int cpu; 147 132 148 - inflight[0] = 0; 149 - inflight[1] = 0; 150 - for_each_possible_cpu(cpu) { 151 - inflight[0] += part_stat_local_read_cpu(part, in_flight[0], cpu); 152 - inflight[1] += part_stat_local_read_cpu(part, in_flight[1], cpu); 133 + if (mq_driver) { 134 + blk_mq_in_driver_rw(part, inflight); 135 + } else { 136 + for_each_possible_cpu(cpu) { 137 + inflight[READ] += part_stat_local_read_cpu( 138 + part, in_flight[READ], cpu); 139 + inflight[WRITE] += part_stat_local_read_cpu( 140 + part, in_flight[WRITE], cpu); 141 + } 153 142 } 154 - if ((int)inflight[0] < 0) 155 - inflight[0] = 0; 156 - if ((int)inflight[1] < 0) 157 - inflight[1] = 0; 143 + 144 + if (WARN_ON_ONCE((int)inflight[READ] < 0)) 145 + inflight[READ] = 0; 146 + if (WARN_ON_ONCE((int)inflight[WRITE] < 0)) 147 + inflight[WRITE] = 0; 158 148 } 149 + 150 + /** 151 + * bdev_count_inflight - get the number of inflight IOs for a block device. 152 + * 153 + * @part: the block device. 154 + * 155 + * Inflight here means started IO accounting, from bdev_start_io_acct() for 156 + * bio-based block device, and from blk_account_io_start() for rq-based block 157 + * device. 158 + */ 159 + unsigned int bdev_count_inflight(struct block_device *part) 160 + { 161 + unsigned int inflight[2] = {0}; 162 + 163 + bdev_count_inflight_rw(part, inflight, false); 164 + 165 + return inflight[READ] + inflight[WRITE]; 166 + } 167 + EXPORT_SYMBOL_GPL(bdev_count_inflight); 159 168 160 169 /* 161 170 * Can be deleted altogether. Later. ··· 1062 1053 struct disk_stats stat; 1063 1054 unsigned int inflight; 1064 1055 1065 - inflight = part_in_flight(bdev); 1056 + inflight = bdev_count_inflight(bdev); 1066 1057 if (inflight) { 1067 1058 part_stat_lock(); 1068 1059 update_io_ticks(bdev, jiffies, true); ··· 1099 1090 (unsigned int)div_u64(stat.nsecs[STAT_FLUSH], NSEC_PER_MSEC)); 1100 1091 } 1101 1092 1093 + /* 1094 + * Show the number of IOs issued to driver. 1095 + * For bio-based device, started from bdev_start_io_acct(); 1096 + * For rq-based device, started from blk_mq_start_request(); 1097 + */ 1102 1098 ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr, 1103 1099 char *buf) 1104 1100 { 1105 1101 struct block_device *bdev = dev_to_bdev(dev); 1106 1102 struct request_queue *q = bdev_get_queue(bdev); 1107 - unsigned int inflight[2]; 1103 + unsigned int inflight[2] = {0}; 1108 1104 1109 - if (queue_is_mq(q)) 1110 - blk_mq_in_flight_rw(q, bdev, inflight); 1111 - else 1112 - part_in_flight_rw(bdev, inflight); 1105 + bdev_count_inflight_rw(bdev, inflight, queue_is_mq(q)); 1113 1106 1114 - return sysfs_emit(buf, "%8u %8u\n", inflight[0], inflight[1]); 1107 + return sysfs_emit(buf, "%8u %8u\n", inflight[READ], inflight[WRITE]); 1115 1108 } 1116 1109 1117 1110 static ssize_t disk_capability_show(struct device *dev, ··· 1366 1355 if (bdev_is_partition(hd) && !bdev_nr_sectors(hd)) 1367 1356 continue; 1368 1357 1369 - inflight = part_in_flight(hd); 1358 + inflight = bdev_count_inflight(hd); 1370 1359 if (inflight) { 1371 1360 part_stat_lock(); 1372 1361 update_io_ticks(hd, jiffies, true);
+3
drivers/md/dm-raid.c
··· 14 14 #include "raid5.h" 15 15 #include "raid10.h" 16 16 #include "md-bitmap.h" 17 + #include "dm-core.h" 17 18 18 19 #include <linux/device-mapper.h> 19 20 ··· 3309 3308 3310 3309 /* Disable/enable discard support on raid set. */ 3311 3310 configure_discard_support(rs); 3311 + rs->md.dm_gendisk = ti->table->md->disk; 3312 3312 3313 3313 mddev_unlock(&rs->md); 3314 3314 return 0; ··· 3329 3327 3330 3328 mddev_lock_nointr(&rs->md); 3331 3329 md_stop(&rs->md); 3330 + rs->md.dm_gendisk = NULL; 3332 3331 mddev_unlock(&rs->md); 3333 3332 3334 3333 if (work_pending(&rs->md.event_work))
+134 -58
drivers/md/md.c
··· 111 111 /* Default safemode delay: 200 msec */ 112 112 #define DEFAULT_SAFEMODE_DELAY ((200 * HZ)/1000 +1) 113 113 /* 114 - * Current RAID-1,4,5 parallel reconstruction 'guaranteed speed limit' 115 - * is 1000 KB/sec, so the extra system load does not show up that much. 116 - * Increase it if you want to have more _guaranteed_ speed. Note that 117 - * the RAID driver will use the maximum available bandwidth if the IO 118 - * subsystem is idle. There is also an 'absolute maximum' reconstruction 119 - * speed limit - in case reconstruction slows down your system despite 120 - * idle IO detection. 114 + * Current RAID-1,4,5,6,10 parallel reconstruction 'guaranteed speed limit' 115 + * is sysctl_speed_limit_min, 1000 KB/sec by default, so the extra system load 116 + * does not show up that much. Increase it if you want to have more guaranteed 117 + * speed. Note that the RAID driver will use the maximum bandwidth 118 + * sysctl_speed_limit_max, 200 MB/sec by default, if the IO subsystem is idle. 121 119 * 122 - * you can change it via /proc/sys/dev/raid/speed_limit_min and _max. 123 - * or /sys/block/mdX/md/sync_speed_{min,max} 120 + * Background sync IO speed control: 121 + * 122 + * - below speed min: 123 + * no limit; 124 + * - above speed min and below speed max: 125 + * a) if mddev is idle, then no limit; 126 + * b) if mddev is busy handling normal IO, then limit inflight sync IO 127 + * to sync_io_depth; 128 + * - above speed max: 129 + * sync IO can't be issued; 130 + * 131 + * Following configurations can be changed via /proc/sys/dev/raid/ for system 132 + * or /sys/block/mdX/md/ for one array. 124 133 */ 125 - 126 134 static int sysctl_speed_limit_min = 1000; 127 135 static int sysctl_speed_limit_max = 200000; 128 - static inline int speed_min(struct mddev *mddev) 136 + static int sysctl_sync_io_depth = 32; 137 + 138 + static int speed_min(struct mddev *mddev) 129 139 { 130 140 return mddev->sync_speed_min ? 131 141 mddev->sync_speed_min : sysctl_speed_limit_min; 132 142 } 133 143 134 - static inline int speed_max(struct mddev *mddev) 144 + static int speed_max(struct mddev *mddev) 135 145 { 136 146 return mddev->sync_speed_max ? 137 147 mddev->sync_speed_max : sysctl_speed_limit_max; 148 + } 149 + 150 + static int sync_io_depth(struct mddev *mddev) 151 + { 152 + return mddev->sync_io_depth ? 153 + mddev->sync_io_depth : sysctl_sync_io_depth; 138 154 } 139 155 140 156 static void rdev_uninit_serial(struct md_rdev *rdev) ··· 309 293 .procname = "speed_limit_min", 310 294 .data = &sysctl_speed_limit_min, 311 295 .maxlen = sizeof(int), 312 - .mode = S_IRUGO|S_IWUSR, 296 + .mode = 0644, 313 297 .proc_handler = proc_dointvec, 314 298 }, 315 299 { 316 300 .procname = "speed_limit_max", 317 301 .data = &sysctl_speed_limit_max, 318 302 .maxlen = sizeof(int), 319 - .mode = S_IRUGO|S_IWUSR, 303 + .mode = 0644, 304 + .proc_handler = proc_dointvec, 305 + }, 306 + { 307 + .procname = "sync_io_depth", 308 + .data = &sysctl_sync_io_depth, 309 + .maxlen = sizeof(int), 310 + .mode = 0644, 320 311 .proc_handler = proc_dointvec, 321 312 }, 322 313 }; ··· 5114 5091 sync_min_show(struct mddev *mddev, char *page) 5115 5092 { 5116 5093 return sprintf(page, "%d (%s)\n", speed_min(mddev), 5117 - mddev->sync_speed_min ? "local": "system"); 5094 + mddev->sync_speed_min ? "local" : "system"); 5118 5095 } 5119 5096 5120 5097 static ssize_t ··· 5123 5100 unsigned int min; 5124 5101 int rv; 5125 5102 5126 - if (strncmp(buf, "system", 6)==0) { 5103 + if (strncmp(buf, "system", 6) == 0) { 5127 5104 min = 0; 5128 5105 } else { 5129 5106 rv = kstrtouint(buf, 10, &min); ··· 5143 5120 sync_max_show(struct mddev *mddev, char *page) 5144 5121 { 5145 5122 return sprintf(page, "%d (%s)\n", speed_max(mddev), 5146 - mddev->sync_speed_max ? "local": "system"); 5123 + mddev->sync_speed_max ? "local" : "system"); 5147 5124 } 5148 5125 5149 5126 static ssize_t ··· 5152 5129 unsigned int max; 5153 5130 int rv; 5154 5131 5155 - if (strncmp(buf, "system", 6)==0) { 5132 + if (strncmp(buf, "system", 6) == 0) { 5156 5133 max = 0; 5157 5134 } else { 5158 5135 rv = kstrtouint(buf, 10, &max); ··· 5167 5144 5168 5145 static struct md_sysfs_entry md_sync_max = 5169 5146 __ATTR(sync_speed_max, S_IRUGO|S_IWUSR, sync_max_show, sync_max_store); 5147 + 5148 + static ssize_t 5149 + sync_io_depth_show(struct mddev *mddev, char *page) 5150 + { 5151 + return sprintf(page, "%d (%s)\n", sync_io_depth(mddev), 5152 + mddev->sync_io_depth ? "local" : "system"); 5153 + } 5154 + 5155 + static ssize_t 5156 + sync_io_depth_store(struct mddev *mddev, const char *buf, size_t len) 5157 + { 5158 + unsigned int max; 5159 + int rv; 5160 + 5161 + if (strncmp(buf, "system", 6) == 0) { 5162 + max = 0; 5163 + } else { 5164 + rv = kstrtouint(buf, 10, &max); 5165 + if (rv < 0) 5166 + return rv; 5167 + if (max == 0) 5168 + return -EINVAL; 5169 + } 5170 + mddev->sync_io_depth = max; 5171 + return len; 5172 + } 5173 + 5174 + static struct md_sysfs_entry md_sync_io_depth = 5175 + __ATTR_RW(sync_io_depth); 5170 5176 5171 5177 static ssize_t 5172 5178 degraded_show(struct mddev *mddev, char *page) ··· 5723 5671 &md_mismatches.attr, 5724 5672 &md_sync_min.attr, 5725 5673 &md_sync_max.attr, 5674 + &md_sync_io_depth.attr, 5726 5675 &md_sync_speed.attr, 5727 5676 &md_sync_force_parallel.attr, 5728 5677 &md_sync_completed.attr, ··· 8625 8572 put_cluster_ops(mddev); 8626 8573 } 8627 8574 8628 - static int is_mddev_idle(struct mddev *mddev, int init) 8575 + static bool is_rdev_holder_idle(struct md_rdev *rdev, bool init) 8629 8576 { 8577 + unsigned long last_events = rdev->last_events; 8578 + 8579 + if (!bdev_is_partition(rdev->bdev)) 8580 + return true; 8581 + 8582 + /* 8583 + * If rdev is partition, and user doesn't issue IO to the array, the 8584 + * array is still not idle if user issues IO to other partitions. 8585 + */ 8586 + rdev->last_events = part_stat_read_accum(rdev->bdev->bd_disk->part0, 8587 + sectors) - 8588 + part_stat_read_accum(rdev->bdev, sectors); 8589 + 8590 + return init || rdev->last_events <= last_events; 8591 + } 8592 + 8593 + /* 8594 + * mddev is idle if following conditions are matched since last check: 8595 + * 1) mddev doesn't have normal IO completed; 8596 + * 2) mddev doesn't have inflight normal IO; 8597 + * 3) if any member disk is partition, and other partitions don't have IO 8598 + * completed; 8599 + * 8600 + * Noted this checking rely on IO accounting is enabled. 8601 + */ 8602 + static bool is_mddev_idle(struct mddev *mddev, int init) 8603 + { 8604 + unsigned long last_events = mddev->normal_io_events; 8605 + struct gendisk *disk; 8630 8606 struct md_rdev *rdev; 8631 - int idle; 8632 - int curr_events; 8607 + bool idle = true; 8633 8608 8634 - idle = 1; 8609 + disk = mddev_is_dm(mddev) ? mddev->dm_gendisk : mddev->gendisk; 8610 + if (!disk) 8611 + return true; 8612 + 8613 + mddev->normal_io_events = part_stat_read_accum(disk->part0, sectors); 8614 + if (!init && (mddev->normal_io_events > last_events || 8615 + bdev_count_inflight(disk->part0))) 8616 + idle = false; 8617 + 8635 8618 rcu_read_lock(); 8636 - rdev_for_each_rcu(rdev, mddev) { 8637 - struct gendisk *disk = rdev->bdev->bd_disk; 8638 - 8639 - if (!init && !blk_queue_io_stat(disk->queue)) 8640 - continue; 8641 - 8642 - curr_events = (int)part_stat_read_accum(disk->part0, sectors) - 8643 - atomic_read(&disk->sync_io); 8644 - /* sync IO will cause sync_io to increase before the disk_stats 8645 - * as sync_io is counted when a request starts, and 8646 - * disk_stats is counted when it completes. 8647 - * So resync activity will cause curr_events to be smaller than 8648 - * when there was no such activity. 8649 - * non-sync IO will cause disk_stat to increase without 8650 - * increasing sync_io so curr_events will (eventually) 8651 - * be larger than it was before. Once it becomes 8652 - * substantially larger, the test below will cause 8653 - * the array to appear non-idle, and resync will slow 8654 - * down. 8655 - * If there is a lot of outstanding resync activity when 8656 - * we set last_event to curr_events, then all that activity 8657 - * completing might cause the array to appear non-idle 8658 - * and resync will be slowed down even though there might 8659 - * not have been non-resync activity. This will only 8660 - * happen once though. 'last_events' will soon reflect 8661 - * the state where there is little or no outstanding 8662 - * resync requests, and further resync activity will 8663 - * always make curr_events less than last_events. 8664 - * 8665 - */ 8666 - if (init || curr_events - rdev->last_events > 64) { 8667 - rdev->last_events = curr_events; 8668 - idle = 0; 8669 - } 8670 - } 8619 + rdev_for_each_rcu(rdev, mddev) 8620 + if (!is_rdev_holder_idle(rdev, init)) 8621 + idle = false; 8671 8622 rcu_read_unlock(); 8623 + 8672 8624 return idle; 8673 8625 } 8674 8626 ··· 8985 8927 } 8986 8928 } 8987 8929 8930 + static bool sync_io_within_limit(struct mddev *mddev) 8931 + { 8932 + int io_sectors; 8933 + 8934 + /* 8935 + * For raid456, sync IO is stripe(4k) per IO, for other levels, it's 8936 + * RESYNC_PAGES(64k) per IO. 8937 + */ 8938 + if (mddev->level == 4 || mddev->level == 5 || mddev->level == 6) 8939 + io_sectors = 8; 8940 + else 8941 + io_sectors = 128; 8942 + 8943 + return atomic_read(&mddev->recovery_active) < 8944 + io_sectors * sync_io_depth(mddev); 8945 + } 8946 + 8988 8947 #define SYNC_MARKS 10 8989 8948 #define SYNC_MARK_STEP (3*HZ) 8990 8949 #define UPDATE_FREQUENCY (5*60*HZ) ··· 9270 9195 msleep(500); 9271 9196 goto repeat; 9272 9197 } 9273 - if (!is_mddev_idle(mddev, 0)) { 9198 + if (!sync_io_within_limit(mddev) && 9199 + !is_mddev_idle(mddev, 0)) { 9274 9200 /* 9275 9201 * Give other IO more of a chance. 9276 9202 * The faster the devices, the less we wait.
+5 -13
drivers/md/md.h
··· 132 132 133 133 sector_t sectors; /* Device size (in 512bytes sectors) */ 134 134 struct mddev *mddev; /* RAID array if running */ 135 - int last_events; /* IO event timestamp */ 135 + unsigned long last_events; /* IO event timestamp */ 136 136 137 137 /* 138 138 * If meta_bdev is non-NULL, it means that a separate device is ··· 404 404 * are happening, so run/ 405 405 * takeover/stop are not safe 406 406 */ 407 - struct gendisk *gendisk; 407 + struct gendisk *gendisk; /* mdraid gendisk */ 408 + struct gendisk *dm_gendisk; /* dm-raid gendisk */ 408 409 409 410 struct kobject kobj; 410 411 int hold_active; ··· 484 483 /* if zero, use the system-wide default */ 485 484 int sync_speed_min; 486 485 int sync_speed_max; 486 + int sync_io_depth; 487 487 488 488 /* resync even though the same disks are shared among md-devices */ 489 489 int parallel_resync; ··· 520 518 * adding a spare 521 519 */ 522 520 521 + unsigned long normal_io_events; /* IO event timestamp */ 523 522 atomic_t recovery_active; /* blocks scheduled, but not written */ 524 523 wait_queue_head_t recovery_wait; 525 524 sector_t recovery_cp; ··· 716 713 return mutex_trylock(&mddev->reconfig_mutex); 717 714 } 718 715 extern void mddev_unlock(struct mddev *mddev); 719 - 720 - static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sectors) 721 - { 722 - if (blk_queue_io_stat(bdev->bd_disk->queue)) 723 - atomic_add(nr_sectors, &bdev->bd_disk->sync_io); 724 - } 725 - 726 - static inline void md_sync_acct_bio(struct bio *bio, unsigned long nr_sectors) 727 - { 728 - md_sync_acct(bio->bi_bdev, nr_sectors); 729 - } 730 716 731 717 struct md_personality 732 718 {
-3
drivers/md/raid1.c
··· 2382 2382 2383 2383 wbio->bi_end_io = end_sync_write; 2384 2384 atomic_inc(&r1_bio->remaining); 2385 - md_sync_acct(conf->mirrors[i].rdev->bdev, bio_sectors(wbio)); 2386 2385 2387 2386 submit_bio_noacct(wbio); 2388 2387 } ··· 3054 3055 bio = r1_bio->bios[i]; 3055 3056 if (bio->bi_end_io == end_sync_read) { 3056 3057 read_targets--; 3057 - md_sync_acct_bio(bio, nr_sectors); 3058 3058 if (read_targets == 1) 3059 3059 bio->bi_opf &= ~MD_FAILFAST; 3060 3060 submit_bio_noacct(bio); ··· 3062 3064 } else { 3063 3065 atomic_set(&r1_bio->remaining, 1); 3064 3066 bio = r1_bio->bios[r1_bio->read_disk]; 3065 - md_sync_acct_bio(bio, nr_sectors); 3066 3067 if (read_targets == 1) 3067 3068 bio->bi_opf &= ~MD_FAILFAST; 3068 3069 submit_bio_noacct(bio);
-9
drivers/md/raid10.c
··· 2426 2426 2427 2427 atomic_inc(&conf->mirrors[d].rdev->nr_pending); 2428 2428 atomic_inc(&r10_bio->remaining); 2429 - md_sync_acct(conf->mirrors[d].rdev->bdev, bio_sectors(tbio)); 2430 2429 2431 2430 if (test_bit(FailFast, &conf->mirrors[d].rdev->flags)) 2432 2431 tbio->bi_opf |= MD_FAILFAST; ··· 2447 2448 bio_copy_data(tbio, fbio); 2448 2449 d = r10_bio->devs[i].devnum; 2449 2450 atomic_inc(&r10_bio->remaining); 2450 - md_sync_acct(conf->mirrors[d].replacement->bdev, 2451 - bio_sectors(tbio)); 2452 2451 submit_bio_noacct(tbio); 2453 2452 } 2454 2453 ··· 2580 2583 d = r10_bio->devs[1].devnum; 2581 2584 if (wbio->bi_end_io) { 2582 2585 atomic_inc(&conf->mirrors[d].rdev->nr_pending); 2583 - md_sync_acct(conf->mirrors[d].rdev->bdev, bio_sectors(wbio)); 2584 2586 submit_bio_noacct(wbio); 2585 2587 } 2586 2588 if (wbio2) { 2587 2589 atomic_inc(&conf->mirrors[d].replacement->nr_pending); 2588 - md_sync_acct(conf->mirrors[d].replacement->bdev, 2589 - bio_sectors(wbio2)); 2590 2590 submit_bio_noacct(wbio2); 2591 2591 } 2592 2592 } ··· 3751 3757 r10_bio->sectors = nr_sectors; 3752 3758 3753 3759 if (bio->bi_end_io == end_sync_read) { 3754 - md_sync_acct_bio(bio, nr_sectors); 3755 3760 bio->bi_status = 0; 3756 3761 submit_bio_noacct(bio); 3757 3762 } ··· 4873 4880 r10_bio->sectors = nr_sectors; 4874 4881 4875 4882 /* Now submit the read */ 4876 - md_sync_acct_bio(read_bio, r10_bio->sectors); 4877 4883 atomic_inc(&r10_bio->remaining); 4878 4884 read_bio->bi_next = NULL; 4879 4885 submit_bio_noacct(read_bio); ··· 4932 4940 continue; 4933 4941 4934 4942 atomic_inc(&rdev->nr_pending); 4935 - md_sync_acct_bio(b, r10_bio->sectors); 4936 4943 atomic_inc(&r10_bio->remaining); 4937 4944 b->bi_next = NULL; 4938 4945 submit_bio_noacct(b);
-8
drivers/md/raid5.c
··· 1240 1240 } 1241 1241 1242 1242 if (rdev) { 1243 - if (s->syncing || s->expanding || s->expanded 1244 - || s->replacing) 1245 - md_sync_acct(rdev->bdev, RAID5_STRIPE_SECTORS(conf)); 1246 - 1247 1243 set_bit(STRIPE_IO_STARTED, &sh->state); 1248 1244 1249 1245 bio_init(bi, rdev->bdev, &dev->vec, 1, op | op_flags); ··· 1296 1300 submit_bio_noacct(bi); 1297 1301 } 1298 1302 if (rrdev) { 1299 - if (s->syncing || s->expanding || s->expanded 1300 - || s->replacing) 1301 - md_sync_acct(rrdev->bdev, RAID5_STRIPE_SECTORS(conf)); 1302 - 1303 1303 set_bit(STRIPE_IO_STARTED, &sh->state); 1304 1304 1305 1305 bio_init(rbi, rrdev->bdev, &dev->rvec, 1, op | op_flags);
-1
include/linux/blkdev.h
··· 182 182 struct list_head slave_bdevs; 183 183 #endif 184 184 struct timer_rand_state *random; 185 - atomic_t sync_io; /* RAID */ 186 185 struct disk_events *ev; 187 186 188 187 #ifdef CONFIG_BLK_DEV_ZONED
+2
include/linux/part_stat.h
··· 79 79 #define part_stat_local_read_cpu(part, field, cpu) \ 80 80 local_read(&(part_stat_get_cpu(part, field, cpu))) 81 81 82 + unsigned int bdev_count_inflight(struct block_device *part); 83 + 82 84 #endif /* _LINUX_PART_STAT_H */