Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP5:Update
drbd
bsc-1203931-17_drbd-only-reschedule-resync-quic...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc-1203931-17_drbd-only-reschedule-resync-quickly-if-resync-sector.patch of Package drbd
From 330c8aa7b64f9fc0ace3c3985528b78aa0ca6780 Mon Sep 17 00:00:00 2001 From: Joel Colledge <joel.colledge@linbit.com> Date: Thu, 4 Feb 2021 15:46:12 +0100 Subject: [PATCH] drbd: only reschedule resync quickly if resync sectors in-flight 8dc8ede32de44 drbd: fix slow sync when sync requests are answered quickly introduced a mechanism to ensure that a resync does not become slow when the responses are so fast that we have nothing to request. However, when there are still in-flight sectors from a previous cycle, there is no need to reschedule quickly. Instead we can just wait for the in-flight sectors to arrive. This situation can occur, for instance, when we have a large value for c-fill-target and hit the "max-buffers in-flight" restriction. Without this fix, the resync work was rescheduled repeatedly but made no new requests until the responses to the older resync requests were received. With this fix, DRBD does the next resync work after the standard delay of 0.1s or when all resync responses are received. --- drbd/drbd_sender.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drbd/drbd_sender.c b/drbd/drbd_sender.c index aa1a3d6c1122..edf6b9d5c1f7 100644 --- a/drbd/drbd_sender.c +++ b/drbd/drbd_sender.c @@ -653,18 +653,28 @@ static int drbd_rs_number_requests(struct drbd_peer_device *peer_device) return number; } -static int drbd_single_request_delay(struct drbd_peer_device *peer_device) +static int drbd_resync_delay(struct drbd_peer_device *peer_device) { struct peer_device_conf *pdc; unsigned long delay; + if (peer_device->rs_in_flight > 0) { + /* Requests in-flight. Use the standard delay. If all responses + * are received before this time, the resync work will be + * scheduled immediately. */ + return RS_MAKE_REQS_INTV; + } + rcu_read_lock(); pdc = rcu_dereference(peer_device->conf); if (rcu_dereference(peer_device->rs_plan_s)->size && pdc->c_max_rate > 0) { - /* The delay should be at least enough so that we can request - * some data next time, so round up. */ + /* Dynamic resync. This occurs when the peer responds so + * quickly to the resync requests that the rate limiting + * prevents any new requests from being made. Wait just long + * enough so that we can request some data next time. */ delay = DIV_ROUND_UP(HZ * BM_SECT_PER_BIT, pdc->c_max_rate * 2); } else { + /* Fixed resync rate. Use the standard delay. */ delay = RS_MAKE_REQS_INTV; } rcu_read_unlock(); @@ -862,8 +872,7 @@ request_done: &peer_device->connection->sender_work, &peer_device->resync_work); } else { - unsigned long delay = number == 0 ? drbd_single_request_delay(peer_device) : RS_MAKE_REQS_INTV; - mod_timer(&peer_device->resync_timer, jiffies + delay); + mod_timer(&peer_device->resync_timer, jiffies + drbd_resync_delay(peer_device)); } put_ldev(device); return 0; -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor