aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2010-11-05 05:05:47 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:19:03 -0500
commit2649f0809f55e4df98c333a2b85c6fc8fee04804 (patch)
treeb275b9af4122fe84965d754b27615c71c8a13a60
parente65f440d474d7d6a6fd8a2c844e851d8c96ed9c5 (diff)
drbd: use the resync controller for online-verify requests as well
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_main.c2
-rw-r--r--drivers/block/drbd/drbd_proc.c3
-rw-r--r--drivers/block/drbd/drbd_receiver.c10
-rw-r--r--drivers/block/drbd/drbd_worker.c8
4 files changed, 14 insertions, 9 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index a1a2cb1eadf1..6afb81f807bd 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1126,6 +1126,8 @@ int __drbd_set_state(struct drbd_conf *mdev,
1126 mdev->rs_mark_time[i] = now; 1126 mdev->rs_mark_time[i] = now;
1127 } 1127 }
1128 1128
1129 drbd_rs_controller_reset(mdev);
1130
1129 if (ns.conn == C_VERIFY_S) { 1131 if (ns.conn == C_VERIFY_S) {
1130 dev_info(DEV, "Starting Online Verify from sector %llu\n", 1132 dev_info(DEV, "Starting Online Verify from sector %llu\n",
1131 (unsigned long long)mdev->ov_position); 1133 (unsigned long long)mdev->ov_position);
diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c
index 0ec6f4b6a4a8..fab3fde3477b 100644
--- a/drivers/block/drbd/drbd_proc.c
+++ b/drivers/block/drbd/drbd_proc.c
@@ -154,7 +154,8 @@ static void drbd_syncer_progress(struct drbd_conf *mdev, struct seq_file *seq)
154 seq_printf_with_thousands_grouping(seq, dbdt); 154 seq_printf_with_thousands_grouping(seq, dbdt);
155 seq_printf(seq, ")"); 155 seq_printf(seq, ")");
156 156
157 if (mdev->state.conn == C_SYNC_TARGET) { 157 if (mdev->state.conn == C_SYNC_TARGET ||
158 mdev->state.conn == C_VERIFY_S) {
158 if (mdev->c_sync_rate > 1000) 159 if (mdev->c_sync_rate > 1000)
159 seq_printf(seq, " want: %d,%03d", 160 seq_printf(seq, " want: %d,%03d",
160 mdev->c_sync_rate / 1000, mdev->c_sync_rate % 1000); 161 mdev->c_sync_rate / 1000, mdev->c_sync_rate % 1000);
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 10db70a23376..1c56af03c38b 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -1883,8 +1883,12 @@ int drbd_rs_should_slow_down(struct drbd_conf *mdev)
1883 1883
1884 /* sync speed average over the last 2*DRBD_SYNC_MARK_STEP, 1884 /* sync speed average over the last 2*DRBD_SYNC_MARK_STEP,
1885 * approx. */ 1885 * approx. */
1886 i = (mdev->rs_last_mark + DRBD_SYNC_MARKS-2) % DRBD_SYNC_MARKS; 1886 i = (mdev->rs_last_mark + DRBD_SYNC_MARKS-1) % DRBD_SYNC_MARKS;
1887 rs_left = drbd_bm_total_weight(mdev) - mdev->rs_failed; 1887
1888 if (mdev->state.conn == C_VERIFY_S || mdev->state.conn == C_VERIFY_T)
1889 rs_left = mdev->ov_left;
1890 else
1891 rs_left = drbd_bm_total_weight(mdev) - mdev->rs_failed;
1888 1892
1889 dt = ((long)jiffies - (long)mdev->rs_mark_time[i]) / HZ; 1893 dt = ((long)jiffies - (long)mdev->rs_mark_time[i]) / HZ;
1890 if (!dt) 1894 if (!dt)
@@ -1992,6 +1996,8 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
1992 D_ASSERT(mdev->agreed_pro_version >= 89); 1996 D_ASSERT(mdev->agreed_pro_version >= 89);
1993 e->w.cb = w_e_end_csum_rs_req; 1997 e->w.cb = w_e_end_csum_rs_req;
1994 } else if (cmd == P_OV_REPLY) { 1998 } else if (cmd == P_OV_REPLY) {
1999 /* track progress, we may need to throttle */
2000 atomic_add(size >> 9, &mdev->rs_sect_in);
1995 e->w.cb = w_e_end_ov_reply; 2001 e->w.cb = w_e_end_ov_reply;
1996 dec_rs_pending(mdev); 2002 dec_rs_pending(mdev);
1997 /* drbd_rs_begin_io done when we sent this request, 2003 /* drbd_rs_begin_io done when we sent this request,
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 6d111c8515f7..af805efc94d7 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -708,11 +708,7 @@ static int w_make_ov_request(struct drbd_conf *mdev, struct drbd_work *w, int ca
708 return 0; 708 return 0;
709 } 709 }
710 710
711 number = SLEEP_TIME*mdev->sync_conf.rate / ((BM_BLOCK_SIZE/1024)*HZ); 711 number = drbd_rs_number_requests(mdev);
712 if (atomic_read(&mdev->rs_pending_cnt) > number)
713 goto requeue;
714
715 number -= atomic_read(&mdev->rs_pending_cnt);
716 712
717 sector = mdev->ov_position; 713 sector = mdev->ov_position;
718 for (i = 0; i < number; i++) { 714 for (i = 0; i < number; i++) {
@@ -741,11 +737,11 @@ static int w_make_ov_request(struct drbd_conf *mdev, struct drbd_work *w, int ca
741 mdev->ov_position = sector; 737 mdev->ov_position = sector;
742 738
743 requeue: 739 requeue:
740 mdev->rs_in_flight += (i << (BM_BLOCK_SHIFT - 9));
744 mod_timer(&mdev->resync_timer, jiffies + SLEEP_TIME); 741 mod_timer(&mdev->resync_timer, jiffies + SLEEP_TIME);
745 return 1; 742 return 1;
746} 743}
747 744
748
749int w_ov_finished(struct drbd_conf *mdev, struct drbd_work *w, int cancel) 745int w_ov_finished(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
750{ 746{
751 kfree(w); 747 kfree(w);