|
@@ -1039,7 +1039,6 @@ static void make_request(struct mddev *mddev, struct bio * bio)
|
|
|
const unsigned long do_fua = (bio->bi_rw & REQ_FUA);
|
|
|
unsigned long flags;
|
|
|
struct md_rdev *blocked_rdev;
|
|
|
- int plugged;
|
|
|
int sectors_handled;
|
|
|
int max_sectors;
|
|
|
int sectors;
|
|
@@ -1239,7 +1238,6 @@ read_again:
|
|
|
* of r10_bios is recored in bio->bi_phys_segments just as with
|
|
|
* the read case.
|
|
|
*/
|
|
|
- plugged = mddev_check_plugged(mddev);
|
|
|
|
|
|
r10_bio->read_slot = -1; /* make sure repl_bio gets freed */
|
|
|
raid10_find_phys(conf, r10_bio);
|
|
@@ -1396,6 +1394,8 @@ retry_write:
|
|
|
bio_list_add(&conf->pending_bio_list, mbio);
|
|
|
conf->pending_count++;
|
|
|
spin_unlock_irqrestore(&conf->device_lock, flags);
|
|
|
+ if (!mddev_check_plugged(mddev, 0, 0))
|
|
|
+ md_wakeup_thread(mddev->thread);
|
|
|
|
|
|
if (!r10_bio->devs[i].repl_bio)
|
|
|
continue;
|
|
@@ -1423,6 +1423,8 @@ retry_write:
|
|
|
bio_list_add(&conf->pending_bio_list, mbio);
|
|
|
conf->pending_count++;
|
|
|
spin_unlock_irqrestore(&conf->device_lock, flags);
|
|
|
+ if (!mddev_check_plugged(mddev))
|
|
|
+ md_wakeup_thread(mddev->thread);
|
|
|
}
|
|
|
|
|
|
/* Don't remove the bias on 'remaining' (one_write_done) until
|
|
@@ -1448,9 +1450,6 @@ retry_write:
|
|
|
|
|
|
/* In case raid10d snuck in to freeze_array */
|
|
|
wake_up(&conf->wait_barrier);
|
|
|
-
|
|
|
- if (do_sync || !mddev->bitmap || !plugged)
|
|
|
- md_wakeup_thread(mddev->thread);
|
|
|
}
|
|
|
|
|
|
static void status(struct seq_file *seq, struct mddev *mddev)
|
|
@@ -2661,7 +2660,8 @@ static void raid10d(struct mddev *mddev)
|
|
|
blk_start_plug(&plug);
|
|
|
for (;;) {
|
|
|
|
|
|
- flush_pending_writes(conf);
|
|
|
+ if (atomic_read(&mddev->plug_cnt) == 0)
|
|
|
+ flush_pending_writes(conf);
|
|
|
|
|
|
spin_lock_irqsave(&conf->device_lock, flags);
|
|
|
if (list_empty(head)) {
|