Skip to content

drbd: fix false positive resync throttling in drbd_rs_c_min_rate_throttle#832

Open
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1094336=>linus-master
Open

drbd: fix false positive resync throttling in drbd_rs_c_min_rate_throttle#832
blktests-ci[bot] wants to merge 1 commit into
linus-master_basefrom
series/1094336=>linus-master

Conversation

@blktests-ci
Copy link
Copy Markdown

@blktests-ci blktests-ci Bot commented May 13, 2026

Pull request for series with
subject: drbd: fix false positive resync throttling in drbd_rs_c_min_rate_throttle
version: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1094336

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 13, 2026

Upstream branch: aa54b1d
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 15, 2026

Upstream branch: 70eda68
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from ec9698e to eb52697 Compare May 15, 2026 08:08
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from ca57796 to c1feb59 Compare May 21, 2026 02:54
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 21, 2026

Upstream branch: 8bc67e4
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from eb52697 to 3bba6f6 Compare May 21, 2026 03:19
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from c1feb59 to ea833a1 Compare May 22, 2026 01:53
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 22, 2026

Upstream branch: 6779b50
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 3bba6f6 to 6d5ca9d Compare May 22, 2026 02:18
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from ea833a1 to 7af85d1 Compare May 23, 2026 06:11
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 23, 2026

Upstream branch: 79bd2dd
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 6d5ca9d to 7b07a8b Compare May 23, 2026 06:41
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 7af85d1 to de94ac7 Compare May 23, 2026 17:08
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 23, 2026

Upstream branch: eed108e
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 7b07a8b to 154f397 Compare May 23, 2026 17:44
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from de94ac7 to 86d8d37 Compare May 26, 2026 15:38
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 26, 2026

Upstream branch: e8c2f9f
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 154f397 to 7b95cb4 Compare May 26, 2026 16:16
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 86d8d37 to 9805659 Compare May 28, 2026 13:24
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 28, 2026

Upstream branch: eb3f4b7
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 7b95cb4 to 58fd6b6 Compare May 28, 2026 15:04
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 9805659 to 3f4a345 Compare May 29, 2026 11:12
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented May 29, 2026

Upstream branch: 8fde5d1
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 58fd6b6 to 0b612a8 Compare May 29, 2026 11:57
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from 3f4a345 to c6dc343 Compare June 1, 2026 08:58
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Jun 1, 2026

Upstream branch: e43ffb6
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 0b612a8 to 2bff906 Compare June 1, 2026 09:46
@blktests-ci blktests-ci Bot force-pushed the linus-master_base branch from c6dc343 to fc36596 Compare June 3, 2026 13:56
@blktests-ci
Copy link
Copy Markdown
Author

blktests-ci Bot commented Jun 3, 2026

Upstream branch: ba3e43a
series: https://patchwork.kernel.org/project/linux-block/list/?series=1094336
version: 1

…ttle

drbd_rs_c_min_rate_throttle() is intended to slow down resync when
genuine application I/O is competing for the backing device.  It used
to detect "application I/O" by comparing the total sector count from
the backing device (part_stat_read_accum) against the resync sector
counter (rs_sect_ev), and throttling when the resync speed exceeds
c-min-rate.

That curr_events heuristic produces false positives:

1) On the receiver path, rs_sect_ev is incremented *after* the throttle
   check.  The current resync I/O is already reflected in part_stat
   counters but not yet in rs_sect_ev, creating a persistent positive
   delta that looks like application I/O.

2) The per-cpu part_stat counters and the atomic rs_sect_ev are not
   read under any common lock, so transient skew between them can
   push the delta above 64 sectors even when no application I/O is
   present.

When the false positive fires, the function compares the resync speed
against c-min-rate (default 35840 KB/s ~ 35 MB/s).  On modern
hardware capable of 300+ MB/s resync the condition is almost always
true, so the caller sleeps 100 ms (HZ/10) per resync request or stops
issuing new requests, capping throughput at roughly c-min-rate.

This was observed in production on a Distributed Cloud controller
where drbd-dc-vault (100 GB) resynced at ~30 MB/s instead of the
expected ~360 MB/s.  Setting c-min-rate above the actual resync speed
(e.g. 350 MB/s) or disabling the feature (c-min-rate 0) restored full
throughput, confirming false-positive throttling as root cause.

Switch the gate to ap_bio_cnt.  inc_ap_bio() is called for every
application bio at the top of drbd_make_request(), before any
activity-log handling, and dec_ap_bio() runs on completion.  That
makes ap_bio_cnt the authoritative "application I/O in flight"
signal, independent of part_stat update timing, per-cpu skew, and
activity-log fastpath outcomes.

Backport of the drbd 9.x fix to the in-tree drbd 8.4 driver.

Suggested-by: Ionut Nechita <ionut.nechita@windriver.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
[inechita: backport to drbd 8.4 - ap_bio_cnt is scalar, not array]
Signed-off-by: Ionut Nechita <ionut.nechita@windriver.com>
@blktests-ci blktests-ci Bot force-pushed the series/1094336=>linus-master branch from 2bff906 to 0afd4dc Compare June 3, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant