diff options
author | NeilBrown <neilb@suse.de> | 2015-02-19 16:55:00 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-04-22 08:00:40 +1000 |
commit | ac8fa4196d205ac8fff3f8932bddbad4f16e4110 (patch) | |
tree | c175a09260711f6e9a149b965fd89090dd679538 /drivers/md/md.c | |
parent | 09314799e4f0589e52bafcd0ca3556c60468bc0e (diff) | |
download | op-kernel-dev-ac8fa4196d205ac8fff3f8932bddbad4f16e4110.zip op-kernel-dev-ac8fa4196d205ac8fff3f8932bddbad4f16e4110.tar.gz |
md: allow resync to go faster when there is competing IO.
When md notices non-sync IO happening while it is trying
to resync (or reshape or recover) it slows down to the
set minimum.
The default minimum might have made sense many years ago
but the drives have become faster. Changing the default
to match the times isn't really a long term solution.
This patch changes the code so that instead of waiting until the speed
has dropped to the target, it just waits until pending requests
have completed.
This means that the delay inserted is a function of the speed
of the devices.
Testing shows that:
- for some loads, the resync speed is unchanged. For those loads
increasing the minimum doesn't change the speed either.
So this is a good result. To increase resync speed under such
loads we would probably need to increase the resync window
size.
- for other loads, resync speed does increase to a reasonable
fraction (e.g. 20%) of maximum possible, and throughput of
the load only drops a little bit (e.g. 10%)
- for other loads, throughput of the non-sync load drops quite a bit
more. These seem to be latency-sensitive loads.
So it isn't a perfect solution, but it is mostly an improvement.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 3b9b032..d4f31e1 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -7880,11 +7880,18 @@ void md_do_sync(struct md_thread *thread) /((jiffies-mddev->resync_mark)/HZ +1) +1; if (currspeed > speed_min(mddev)) { - if ((currspeed > speed_max(mddev)) || - !is_mddev_idle(mddev, 0)) { + if (currspeed > speed_max(mddev)) { msleep(500); goto repeat; } + if (!is_mddev_idle(mddev, 0)) { + /* + * Give other IO more of a chance. + * The faster the devices, the less we wait. + */ + wait_event(mddev->recovery_wait, + !atomic_read(&mddev->recovery_active)); + } } } printk(KERN_INFO "md: %s: %s %s.\n",mdname(mddev), desc, |