A subflow that is slow relative to the others can soak up connection
resources and head-of-line-block the aggregate stream. This series lets the
packet scheduler send less than such a subflow's congestion window by halving
it, and leaves the congestion control to grow it back. It implements
issue #345 [1]. This is a deliberately simple first form; please treat it
as an RFC.
- Patch 1: a prerequisite fix. The scheduler truncates the pacing rate to a
u32, which skews subflow selection on fast paths (Fixes).
- Patch 2: penalise a slow subflow by halving its cwnd, rate-triggered and
gated on the fast path being cwnd-limited.
- Patch 3: skip the penalty when the transfer is receive-window-limited,
where it would otherwise slow the transfer.
- Patch 4: MPTcpExt counters and a dedicated mptcp_subflow_penalise
tracepoint for observability.
Validation, baseline versus this series (test helper, its run_matrix.sh
base-vs-patch driver, and run steps are in [2]):
- No regression in the mptcp selftests.
- No regression versus baseline across the buffer-limited transfers
(send-buffer, receive-window, both, sndbuf>rcvbuf): the penalised two-path
completion time matches the unpatched kernel. Where the slow subflow is
beneficial (send-buffer-limited), the two-path transfer stays faster than the
fast path alone.
- Patch 3's gate keeps the penalty from firing when receive-window-limited,
where halving cwnd would slow the transfer.
- With a bufferbloated slow path, the penalty roughly halves the slow path's
queueing latency (subflow srtt), with the transfer time unchanged. It does
not reduce the aggregate out-of-order volume or move data off the slow path;
that is the role of #332, and the two are complementary.
- One regime, unbounded buffers with a purely delay-slow path, shows a
throughput cost that grows with the delay; the current gates do not catch it.
On patch 4: observability is a dedicated mptcp_subflow_penalise tracepoint
rather than a field on the existing mptcp_subflow_get_send. The penalise verdict
is only known after the selection loop, so a field there would need a second,
post-decision emit plus a marker to tell it apart from the per-candidate emits,
and would make existing get_send consumers count an extra event per call. A
dedicated tracepoint avoids the double emit and leaves mptcp_subflow_get_send
untouched. Happy to use a field instead if you prefer.
[1] https://github.com/multipath-tcp/mptcp_net-next/issues/345
[2] https://github.com/shardulsdk-mpiric/linux/blob/161a4bd556eb/tools/testing/selftests/net/mptcp/mptcp_sched_penalise.sh
(run_matrix.sh + runs.conf are alongside it in the same directory)
Changes in v2
- Patch 1 (new, not in v1): fix the scheduler's pre-existing u32 pacing-rate
truncation (Fixes: 3ce0852c86b9).
- Patch 2 (v1's 1/3): also skip a subflow already at the cwnd floor
(MPTCP_PENALISE_MIN_CWND); clear the flag when returning without send-window
room; re-check TCP_CA_Open in the apply path; express the rate trigger as a
division (avg_pacing_rate < max_pace / ratio, using the widened pace from
patch 1) instead of a u64-cast multiply.
- Patch 3 (v1's 2/3): make the receive-window test wrap-safe
(after64, like tcp_snd_wnd_test()); same condition otherwise.
- Patch 4 (v1's 3/3): real MPTcpExt counters (dropped DO-NOT-MERGE) plus
a dedicated mptcp_subflow_penalise tracepoint (not a field on
mptcp_subflow_get_send).
- Rebased on current export.
- Link to v1:
https://lore.kernel.org/mptcp/20260726-mptcp_penalise_send-v1-0-84485e0e995b@mpiricsoftware.com
Signed-off-by: Shardul Bankar <shardul.b@mpiricsoftware.com>
---
Shardul Bankar (4):
mptcp: sched: avoid truncating the pacing rate in the scheduler
mptcp: sched: penalise a slow subflow by halving its cwnd
mptcp: sched: do not penalise when receive-window-limited
mptcp: sched: add penalise counters and tracepoint
include/trace/events/mptcp.h | 30 ++++++++++++++++
net/mptcp/mib.c | 2 ++
net/mptcp/mib.h | 2 ++
net/mptcp/protocol.c | 85 ++++++++++++++++++++++++++++++++++++++++----
net/mptcp/protocol.h | 2 ++
5 files changed, 115 insertions(+), 6 deletions(-)
---
base-commit: be46c85306e63c58c223ce02074ed4ba7f21971b
change-id: 20260815-mptcp_penalise_send_v2-ed6206f70a84
Best regards,
--
Shardul Bankar <shardul.b@mpiricsoftware.com>