md: use new plugging interface for RAID IO.
authorNeilBrown <neilb@suse.de>
Mon, 18 Apr 2011 08:25:41 +0000 (18:25 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 18 Apr 2011 08:25:41 +0000 (18:25 +1000)
md/raid submits a lot of IO from the various raid threads.
So adding start/finish plug calls to those so that some
plugging happens.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c

index c2a21ae56d977d6249f9c8501f124e50c48f15dd..5449cd5e31413bd70ddcbdb8c617b052a51a3d78 100644 (file)
@@ -1516,9 +1516,11 @@ static void raid1d(mddev_t *mddev)
        conf_t *conf = mddev->private;
        struct list_head *head = &conf->retry_list;
        mdk_rdev_t *rdev;
+       struct blk_plug plug;
 
        md_check_recovery(mddev);
-       
+
+       blk_start_plug(&plug);
        for (;;) {
                char b[BDEVNAME_SIZE];
 
@@ -1593,6 +1595,7 @@ static void raid1d(mddev_t *mddev)
                }
                cond_resched();
        }
+       blk_finish_plug(&plug);
 }
 
 
index 2da83d5665925eea27b441e954ca145569278055..c8e5dac5d6952da799a4b12fbd408cb8c79474c0 100644 (file)
@@ -1640,9 +1640,11 @@ static void raid10d(mddev_t *mddev)
        conf_t *conf = mddev->private;
        struct list_head *head = &conf->retry_list;
        mdk_rdev_t *rdev;
+       struct blk_plug plug;
 
        md_check_recovery(mddev);
 
+       blk_start_plug(&plug);
        for (;;) {
                char b[BDEVNAME_SIZE];
 
@@ -1716,6 +1718,7 @@ static void raid10d(mddev_t *mddev)
                }
                cond_resched();
        }
+       blk_finish_plug(&plug);
 }
 
 
index e867ee42b15239707c0dfede4be71d2bc9a72e20..ce6960b1c682290157c85e871e00d90427515311 100644 (file)
@@ -4478,11 +4478,13 @@ static void raid5d(mddev_t *mddev)
        struct stripe_head *sh;
        raid5_conf_t *conf = mddev->private;
        int handled;
+       struct blk_plug plug;
 
        pr_debug("+++ raid5d active\n");
 
        md_check_recovery(mddev);
 
+       blk_start_plug(&plug);
        handled = 0;
        spin_lock_irq(&conf->device_lock);
        while (1) {
@@ -4525,6 +4527,7 @@ static void raid5d(mddev_t *mddev)
        spin_unlock_irq(&conf->device_lock);
 
        async_tx_issue_pending_all();
+       blk_finish_plug(&plug);
 
        pr_debug("--- raid5d inactive\n");
 }