From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: "Jonas Köppeler" <j.koeppeler@tu-berlin.de>,
"Jamal Hadi Salim" <jhs@mojatatu.com>,
"Jiri Pirko" <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>
Cc: cake@lists.bufferbloat.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, Mike Pham <mikepham4321@gmail.com>
Subject: [Cake] Re: [PATCH net-next v2] net/sched: sch_cake: skip clearing unused tins during rate adjustment
Date: Tue, 21 Jul 2026 08:55:23 +0200 [thread overview]
Message-ID: <D8203772-A5C3-480E-88E5-52098FA91AAB@toke.dk> (raw)
In-Reply-To: <20260720-sch_cake-skip-clearing-tins-v2-1-e6a8b0275c73@tu-berlin.de>
On 20 July 2026 23.14.52 CEST, "Jonas Köppeler" <j.koeppeler@tu-berlin.de> wrote:
>When cake_configure_rates() is called from the dequeue path with
>rate_adjust=true, it only needs to update the rate parameters. The
>loop that clears the unused tins is both unnecessary and harmful in
>this path:
>
> - cake_clear_tin() overwrites q->cur_tin and q->cur_flow, which are
> actively used by cake_dequeue(), corrupting the dequeue state.
> - iterating over the unused tins and their internal queues to purge
> packets adds needless overhead to the hot path.
>
>Skip the entire loop when rate_adjust is set, as neither
>cake_clear_tin() nor the mtu_time update are needed when only the
>rate changes.
>
>The clearing loop runs on every rate adjustment from the dequeue path,
>clearing (max_tins - cur_tins) tins each time, so the cost grows the
>fewer tins the configured mode actually uses. Testing cake_mq over veth
>(8 rx/tx queues, 2 Gbit limit) with flent's [1] rrul and tcp_nup tests and
>32 TCP upstreams shows a large drop in loaded latency and a throughput
>gain, restoring behaviour to pre-15c2715a5264 levels:
>
> +------------+------+------+-------+-------+---------+
> | kernel | mode | test | base | load | tput |
> | | | | (ms) | (ms) | (Mbit) |
> +------------+------+------+-------+-------+---------+
> | net-next | be | rrul | 0.810 | 11.78 | 1469.67 |
> | net-next | be | nup | 0.637 | 85.71 | 1243.15 |
> | net-next | ds3 | rrul | 0.397 | 15.28 | 1770.06 |
> | net-next | ds3 | nup | 0.351 | 15.98 | 1799.39 |
> +------------+------+------+-------+-------+---------+
> | patched | be | rrul | 0.092 | 0.56 | 1873.40 |
> | patched | be | nup | 0.109 | 1.82 | 1869.12 |
> | patched | ds3 | rrul | 0.097 | 0.98 | 1866.10 |
> | patched | ds3 | nup | 0.101 | 0.51 | 1861.79 |
> +------------+------+------+-------+-------+---------+
>
>The same trend holds on real hardware (IPQ8074A, 4 rx/tx queues,
>OpenWrt): in besteffort mode the tcp_nup loaded latency drops from
>~470 ms to ~4 ms.
>
>[1] https://flent.org
>
>Fixes: 15c2715a5264 ("net/sched: sch_cake: fixup cake_mq rate adjustment for diffserv config")
>Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
>Tested-by: Mike Pham <mikepham4321@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
prev parent reply other threads:[~2026-07-21 6:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 21:14 [Cake] [PATCH net-next v2] net/sched: sch_cake: skip clearing unused tins during rate adjustment Jonas Köppeler
2026-07-21 6:55 ` Toke Høiland-Jørgensen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D8203772-A5C3-480E-88E5-52098FA91AAB@toke.dk \
--to=toke@toke.dk \
--cc=cake@lists.bufferbloat.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=j.koeppeler@tu-berlin.de \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikepham4321@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox