File tree 4 files changed +17
-19
lines changed
4 files changed +17
-19
lines changed Original file line number Diff line number Diff line change @@ -8087,7 +8087,8 @@ void md_wakeup_thread(struct md_thread __rcu *thread)
8087
8087
if (t ) {
8088
8088
pr_debug ("md: waking up MD thread %s.\n" , t -> tsk -> comm );
8089
8089
set_bit (THREAD_WAKEUP , & t -> flags );
8090
- wake_up (& t -> wqueue );
8090
+ if (wq_has_sleeper (& t -> wqueue ))
8091
+ wake_up (& t -> wqueue );
8091
8092
}
8092
8093
rcu_read_unlock ();
8093
8094
}
@@ -8576,14 +8577,19 @@ static int is_mddev_idle(struct mddev *mddev, int init)
8576
8577
{
8577
8578
struct md_rdev * rdev ;
8578
8579
int idle ;
8579
- int curr_events ;
8580
+ long long curr_events ;
8580
8581
8581
8582
idle = 1 ;
8582
8583
rcu_read_lock ();
8583
8584
rdev_for_each_rcu (rdev , mddev ) {
8584
8585
struct gendisk * disk = rdev -> bdev -> bd_disk ;
8585
- curr_events = (int )part_stat_read_accum (disk -> part0 , sectors ) -
8586
- atomic_read (& disk -> sync_io );
8586
+
8587
+ if (!init && !blk_queue_io_stat (disk -> queue ))
8588
+ continue ;
8589
+
8590
+ curr_events =
8591
+ (long long )part_stat_read_accum (disk -> part0 , sectors ) -
8592
+ atomic64_read (& disk -> sync_io );
8587
8593
/* sync IO will cause sync_io to increase before the disk_stats
8588
8594
* as sync_io is counted when a request starts, and
8589
8595
* disk_stats is counted when it completes.
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ struct md_rdev {
51
51
52
52
sector_t sectors ; /* Device size (in 512bytes sectors) */
53
53
struct mddev * mddev ; /* RAID array if running */
54
- int last_events ; /* IO event timestamp */
54
+ long long last_events ; /* IO event timestamp */
55
55
56
56
/*
57
57
* If meta_bdev is non-NULL, it means that a separate device is
@@ -621,7 +621,8 @@ extern void mddev_unlock(struct mddev *mddev);
621
621
622
622
static inline void md_sync_acct (struct block_device * bdev , unsigned long nr_sectors )
623
623
{
624
- atomic_add (nr_sectors , & bdev -> bd_disk -> sync_io );
624
+ if (blk_queue_io_stat (bdev -> bd_disk -> queue ))
625
+ atomic64_add (nr_sectors , & bdev -> bd_disk -> sync_io );
625
626
}
626
627
627
628
static inline void md_sync_acct_bio (struct bio * bio , unsigned long nr_sectors )
Original file line number Diff line number Diff line change 36
36
*/
37
37
38
38
#include <linux/blkdev.h>
39
- #include <linux/delay.h>
40
39
#include <linux/kthread.h>
41
40
#include <linux/raid/pq.h>
42
41
#include <linux/async_tx.h>
@@ -6734,6 +6733,9 @@ static void raid5d(struct md_thread *thread)
6734
6733
int batch_size , released ;
6735
6734
unsigned int offset ;
6736
6735
6736
+ if (test_bit (MD_SB_CHANGE_PENDING , & mddev -> sb_flags ))
6737
+ break ;
6738
+
6737
6739
released = release_stripe_list (conf , conf -> temp_inactive_list );
6738
6740
if (released )
6739
6741
clear_bit (R5_DID_ALLOC , & conf -> cache_state );
@@ -6770,18 +6772,7 @@ static void raid5d(struct md_thread *thread)
6770
6772
spin_unlock_irq (& conf -> device_lock );
6771
6773
md_check_recovery (mddev );
6772
6774
spin_lock_irq (& conf -> device_lock );
6773
-
6774
- /*
6775
- * Waiting on MD_SB_CHANGE_PENDING below may deadlock
6776
- * seeing md_check_recovery() is needed to clear
6777
- * the flag when using mdmon.
6778
- */
6779
- continue ;
6780
6775
}
6781
-
6782
- wait_event_lock_irq (mddev -> sb_wait ,
6783
- !test_bit (MD_SB_CHANGE_PENDING , & mddev -> sb_flags ),
6784
- conf -> device_lock );
6785
6776
}
6786
6777
pr_debug ("%d stripes handled\n" , handled );
6787
6778
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ struct gendisk {
172
172
struct list_head slave_bdevs ;
173
173
#endif
174
174
struct timer_rand_state * random ;
175
- atomic_t sync_io ; /* RAID */
175
+ atomic64_t sync_io ; /* RAID */
176
176
struct disk_events * ev ;
177
177
178
178
#ifdef CONFIG_BLK_DEV_ZONED
You can’t perform that action at this time.
0 commit comments