summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.h
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2017-10-24 15:11:52 +0800
committerShaohua Li <shli@fb.com>2017-11-01 21:32:23 -0700
commit8db87912c9a8771c53b98845cd5516ea63b22e1e (patch)
treeea7749f6fbd11a75218e9710f8298c3fe5766d31 /drivers/md/raid10.h
parentcb8a7a7e1098e74d36378b992a6d012668ec10d9 (diff)
downloadlinux-stable-8db87912c9a8771c53b98845cd5516ea63b22e1e.tar.gz
linux-stable-8db87912c9a8771c53b98845cd5516ea63b22e1e.tar.bz2
linux-stable-8db87912c9a8771c53b98845cd5516ea63b22e1e.zip
md-cluster: Use a small window for raid10 resync
Suspending the entire device for resync could take too long. Resync in small chunks. cluster's resync window is maintained in r10conf as cluster_sync_low and cluster_sync_high, and processed in raid10's sync_request(). If the current resync is outside the cluster resync window: 1. Set the cluster_sync_low to curr_resync_completed. 2. Set cluster_sync_high to cluster_sync_low + stripe size. 3. Send a message to all nodes so they may add it in their suspension list. Note: We only support "near" raid10 so far, resync a far or offset raid10 array could have trouble. So raid10_run checks the layout of clustered raid10, it will refuse to run if the layout is not correct. With the "near" layout we process one stripe at a time progressing monotonically through the address space. So we can have a sliding window of whole-stripes which moves through the array suspending IO on other nodes, and both resync which uses array addresses and recovery which uses device addresses can stay within this window. Signed-off-by: Guoqing Jiang <gqjiang@suse.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid10.h')
-rw-r--r--drivers/md/raid10.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h
index 735ce1a3d260..2bef4e8789c8 100644
--- a/drivers/md/raid10.h
+++ b/drivers/md/raid10.h
@@ -88,6 +88,12 @@ struct r10conf {
* the new thread here until we fully activate the array.
*/
struct md_thread *thread;
+
+ /*
+ * Keep track of cluster resync window to send to other nodes.
+ */
+ sector_t cluster_sync_low;
+ sector_t cluster_sync_high;
};
/*