Re: [PATCH mptcp-next 0/3] mptcp: sched: penalise a slow subflow (#345, first cut for your lab)

Matthieu Baerts <[email protected]> Wed, 29 Jul 2026 13:48:59 +0200
Newsgroups dev.linux.lists.mptcp
Organization NGI0 Core
Message-ID <[email protected]>
Hi Shardul,

On 26/07/2026 07:55, Shardul Bankar wrote:
> Hi Matt,
> 
> Following up on my note about aligning #345 to mptcp_rcv_buf_optimization():
> here is a first cut, as a 3-patch series. A few things came out differently
> from what I described there, so I have called each one out below rather than
> leave it for you to spot.
> 
>   1/3 penalise a slow subflow by halving its cwnd
>   2/3 do not penalise when receive-window-limited
>   3/3 DO-NOT-MERGE counters (for testing only)
> 
> 1/3 is the simple version. In the scheduler, once a subflow is picked, it is
> flagged for a cwnd halving that is applied in the push path under the subflow
> socket lock (so it is safe with the per-subflow locks, as I mentioned). The
> flag is set when the subflow is clearly slower than the fastest path, the
> fastest path is cwnd-limited, and the subflow is in TCP_CA_Open. The reduction
> halves cwnd (and ssthresh if cwnd is past it), at most once per RTT, and the
> congestion control grows it back.

Thank you for having sent these patches!

Note for others: these were supposed to be offlist RFC patches, as an
iteration for the development we started off list, but they were
accidentally shared here. I think that's fine, sorry for the noise, but
please consider this series as an RFC.

I have some questions and small comments.

> What differs from what I described, and why:
> 
> - Trigger on delivery rate, not RTT. I had said "slower by RTT". In testing
>   that over-penalised a path that is only higher latency but still carries its
>   share of the traffic (equal bandwidth, unequal delay): it fires on the
>   slower-by-latency path even though shrinking its window loses real goodput.
>   Keying on the pacing rate instead (penalise only a path whose rate is below
>   half the fastest) targets a genuinely low-throughput path, and reuses the
>   avg_pacing_rate the scheduler already maintains. On the threshold I raised
>   with you (the fork's "any slower" versus a small factor): I had said I would
>   default to "any slower", but with a rate trigger that fires on almost every
>   non-fastest path, since rates always vary a little, so I used the factor to
>   keep it to genuinely slow paths, as I flagged might be needed. Half is just
>   a starting point, easy to tune.

Sounds good to me!

> - I did not carry over the fork's "meta is send-buffer-limited" gate. In
>   mainline the msk send buffer is the sum of the subflow send buffers, and it
>   is effectively never full when the scheduler samples it (the scheduler runs
>   on the push path, just after an ACK has opened room), so that gate never
>   fires and the penalty stays dormant. That is why 1/3 has no send-buffer
>   condition.
> 
> - 2/3 is a guard that is in neither the fork nor what I described. Without it,
>   1/3 regresses badly (about 2x slower in my runs) when the connection is
>   receive-window-limited. In that case the fastest path is capped by the same
>   shared window, so it cannot absorb what the slow path gives up, and halving
>   just sheds the slow path's throughput. 2/3 skips the penalty while the
>   application has queued past the send-window edge (write_seq > wnd_end), which
>   is the sign that the receiver, not our congestion window, is the bottleneck.
>   I kept it a separate patch so you can test 1/3 on its own, or drop or retune
>   2/3 independently. The exact condition is the piece I would most value your
>   lab checking.

It feels to me that you require this because patch 1/3 doesn't check if
the MPTCP connection was "send-buffer-limited", no? But you are doing
something very similar, no? Without testing, it feels like this is
required not to limit the penalisation to when it is really needed.

> Testing was local (network namespaces plus netem, patched against a clean
> mptcp/export), starting from the existing simult_flows selftest. It is a debug
> kernel and mostly single runs, so please read the numbers as directional; I am
> happy to share the full logs and the scenario script.
> 
> - No regression on the simult_flows suite.
> - To see the intended effect I looked at MPTcpExtOFOQueue, the number of
>   segments the receiver had to hold out of order over the transfer, since that
>   is what the change is meant to reduce and a plain throughput number cannot
>   show it. On the asymmetric-bandwidth pair (10 vs 3 mbit) with a small
>   SO_SNDBUF, that count fell by roughly a fifth (about 18 to 23% in my runs)
>   with no change in throughput. So this is a reduction in reordering, i.e. a
>   latency and smoothness effect, not more bytes per second; whether that is
>   worth it for a real workload is exactly what I hope your lab can judge.
> - The receive-window-limited regression above is back to baseline with 2/3.
> - Two honest limits. First, with fully autotuned buffers (the common default)
>   the guard does not fire, because the connection is not receive-window-
>   limited, and the penalty then leaves a small reordering cost: halving trims
>   the slow path's delivery rate, so its share of the in-order stream arrives a
>   little later and the out-of-order count rises a few percent. I did not find a
>   simple way to also suppress
>   that without re-opening the gating, and I did not want to over-build v1;
>   scoping it more tightly (for example only when send-buffer-limited) may be
>   the right call and I would defer to your lab on it. Second, I have only
>   exercised two subflows and no backup subflow so far.
> 
> 3/3 adds two MPTcpExt counters (CwndPenalized, PenalCandidate) so a run can
> tell "the guard held the penalty back" from "the trigger never fired". Not for
> merge. I left your Co-developed-by on it in case it is useful to you elsewhere.
> 
> I drove those regimes with a small simult_flows variant (receive-window-
> limited, send-buffer-limited, and autotuned cases). It is a helper, not
> selftest quality, so I did not fold it into the series; it is on a branch of
> my tree, in case it saves your lab time or you spot a case I missed:
> 
> https://github.com/shardulsdk-mpiric/linux/blob/6926c4b7f583/tools/testing/selftests/net/mptcp/mptcp_sched_penalise.sh
> 
> Run it on a baseline and a patched kernel and compare (prefix with
> MPTCP_LIB_IP_MPTCP=1 if pm_nl_ctl does not work in your setup):
> 
>   SCENARIO=suite                              ./mptcp_sched_penalise.sh
>   SCENARIO=unbounded                          ./mptcp_sched_penalise.sh
>   SCENARIO=rwnd    RCVBUF=262144              ./mptcp_sched_penalise.sh
>   SCENARIO=sndbuf  SNDBUF=65536               ./mptcp_sched_penalise.sh
>   SCENARIO=both    RCVBUF=262144 SNDBUF=65536 ./mptcp_sched_penalise.sh

Sounds good! Did you check with a fixed sndbuf higher than the rcv one?

Also, be careful that with netem, the limits you give to run_test() can
influence a lot the bufferbloat. Did you monitor the RTTs during these
transfers?

On the other hand, it would be good to validate this with one path
having bufferbloat. These patches should also help to improve the
situation. (And issue #332 should help even more)

> For the rwnd/sndbuf/both scenarios the simult_flows pass/fail bound is not
> meaningful (it assumes both paths are fully used): read the printed runtime
> and out-of-order counts, not OK/FAIL. The "both" case also occasionally fails
> to bring up the second subflow with the very small SO_SNDBUF; just rerun it if
> you see a single-subflow run.

I see, yes. I think what is important here for #345, is that when the
transfer is buffer limited, the slow subflow impact should be reduced.
At least not to cause the transfer to be worse than without this slow
subflow.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.