diff options
author | Goldwyn Rodrigues <rgoldwyn@suse.com> | 2015-08-18 18:14:42 -0400 |
---|---|---|
committer | Goldwyn Rodrigues <rgoldwyn@suse.com> | 2015-10-12 02:32:05 -0400 |
commit | c40f341f1e7fd4eddcfc5881d94cfa8669071ee6 (patch) | |
tree | d8d572cb6b88dcd1102596d31b2bd153f79fdaab /drivers/md/bitmap.c | |
parent | 3c462c880b52aae2cfbbb8db8b401eef118cc128 (diff) |
md-cluster: Use a small window for resync
Suspending the entire device for resync could take too long. Resync
in small chunks.
cluster's resync window (32M) is maintained in r1conf as
cluster_sync_low and cluster_sync_high and processed in
raid1's sync_request(). If the current resync is outside the cluster
resync window:
1. Set the cluster_sync_low to curr_resync_completed.
2. Check if the sync will fit in the new window, if not issue a
wait_barrier() and set cluster_sync_low to sector_nr.
3. Set cluster_sync_high to cluster_sync_low + resync_window.
4. Send a message to all nodes so they may add it in their suspension
list.
bitmap_cond_end_sync is modified to allow to force a sync inorder
to get the curr_resync_completed uptodate with the sector passed.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index e9d3ee703e6d..4f22e919787a 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1570,7 +1570,7 @@ void bitmap_close_sync(struct bitmap *bitmap) | |||
1570 | } | 1570 | } |
1571 | EXPORT_SYMBOL(bitmap_close_sync); | 1571 | EXPORT_SYMBOL(bitmap_close_sync); |
1572 | 1572 | ||
1573 | void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector) | 1573 | void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector, bool force) |
1574 | { | 1574 | { |
1575 | sector_t s = 0; | 1575 | sector_t s = 0; |
1576 | sector_t blocks; | 1576 | sector_t blocks; |
@@ -1581,7 +1581,7 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector) | |||
1581 | bitmap->last_end_sync = jiffies; | 1581 | bitmap->last_end_sync = jiffies; |
1582 | return; | 1582 | return; |
1583 | } | 1583 | } |
1584 | if (time_before(jiffies, (bitmap->last_end_sync | 1584 | if (!force && time_before(jiffies, (bitmap->last_end_sync |
1585 | + bitmap->mddev->bitmap_info.daemon_sleep))) | 1585 | + bitmap->mddev->bitmap_info.daemon_sleep))) |
1586 | return; | 1586 | return; |
1587 | wait_event(bitmap->mddev->recovery_wait, | 1587 | wait_event(bitmap->mddev->recovery_wait, |