Commit e1dfa0a2 authored by NeilBrown's avatar NeilBrown
Browse files

md: use new plugging interface for RAID IO.



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: default avatarNeilBrown <neilb@suse.de>
parent 99e22598
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1516,9 +1516,11 @@ static void raid1d(mddev_t *mddev)
	conf_t *conf = mddev->private;
	conf_t *conf = mddev->private;
	struct list_head *head = &conf->retry_list;
	struct list_head *head = &conf->retry_list;
	mdk_rdev_t *rdev;
	mdk_rdev_t *rdev;
	struct blk_plug plug;


	md_check_recovery(mddev);
	md_check_recovery(mddev);


	blk_start_plug(&plug);
	for (;;) {
	for (;;) {
		char b[BDEVNAME_SIZE];
		char b[BDEVNAME_SIZE];


@@ -1593,6 +1595,7 @@ static void raid1d(mddev_t *mddev)
		}
		}
		cond_resched();
		cond_resched();
	}
	}
	blk_finish_plug(&plug);
}
}




+3 −0
Original line number Original line Diff line number Diff line
@@ -1640,9 +1640,11 @@ static void raid10d(mddev_t *mddev)
	conf_t *conf = mddev->private;
	conf_t *conf = mddev->private;
	struct list_head *head = &conf->retry_list;
	struct list_head *head = &conf->retry_list;
	mdk_rdev_t *rdev;
	mdk_rdev_t *rdev;
	struct blk_plug plug;


	md_check_recovery(mddev);
	md_check_recovery(mddev);


	blk_start_plug(&plug);
	for (;;) {
	for (;;) {
		char b[BDEVNAME_SIZE];
		char b[BDEVNAME_SIZE];


@@ -1716,6 +1718,7 @@ static void raid10d(mddev_t *mddev)
		}
		}
		cond_resched();
		cond_resched();
	}
	}
	blk_finish_plug(&plug);
}
}




+3 −0
Original line number Original line Diff line number Diff line
@@ -4478,11 +4478,13 @@ static void raid5d(mddev_t *mddev)
	struct stripe_head *sh;
	struct stripe_head *sh;
	raid5_conf_t *conf = mddev->private;
	raid5_conf_t *conf = mddev->private;
	int handled;
	int handled;
	struct blk_plug plug;


	pr_debug("+++ raid5d active\n");
	pr_debug("+++ raid5d active\n");


	md_check_recovery(mddev);
	md_check_recovery(mddev);


	blk_start_plug(&plug);
	handled = 0;
	handled = 0;
	spin_lock_irq(&conf->device_lock);
	spin_lock_irq(&conf->device_lock);
	while (1) {
	while (1) {
@@ -4525,6 +4527,7 @@ static void raid5d(mddev_t *mddev)
	spin_unlock_irq(&conf->device_lock);
	spin_unlock_irq(&conf->device_lock);


	async_tx_issue_pending_all();
	async_tx_issue_pending_all();
	blk_finish_plug(&plug);


	pr_debug("--- raid5d inactive\n");
	pr_debug("--- raid5d inactive\n");
}
}