Netdev List
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: "Shubhang Kaushik (Ampere)" <sh@gentwo.org>,
	"Jamal Hadi Salim" <jhs@mojatatu.com>,
	"Jiri Pirko" <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	"Jonas Köppeler" <j.koeppeler@tu-berlin.de>,
	"Shubhang Kaushik" <shubhang@os.amperecomputing.com>,
	"Christoph Lameter (Ampere)" <cl@gentwo.org>
Cc: cake@lists.bufferbloat.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Shubhang Kaushik (Ampere)" <sh@gentwo.org>
Subject: Re: [PATCH v2] net/sched: sch_cake: skip redundant cake_mq rate updates
Date: Tue, 27 Oct 2026 10:55:03 +0100	[thread overview]
Message-ID: <8733trpix4.fsf@toke.dk> (raw)
In-Reply-To: <20261026-net_sched_sch_cake-v2-1-cb1d4e6ed990@gentwo.org>

"Shubhang Kaushik (Ampere)" <sh@gentwo.org> writes:

> cake_mq periodically counts active child qdiscs in cake_dequeue() and
> derives an effective per-child shaper rate. cake_dequeue() currently
> reconfigures every tin after each scan, even when that effective rate
> is unchanged.
>
> The dequeue-time call chain is:
>
>   cake_dequeue()
>     -> cake_configure_rates(..., true)
>       -> cake_config_*()
>         -> cake_set_rate()
>
> With rate_adjust=true, cake_set_rate() only refreshes rate-derived
> state. Tin 0 records the unscaled rate argument in every supported
> CAKE tin mode, so its installed rate identifies whether this call chain
> would change any state.
>
> Skip the reconfiguration when the effective rate is already installed,
> while continuing to update the activity-sampling timestamp and
> active-queue statistic.
>
> Fixes: 1bddd758bac2 ("net/sched: sch_cake: share shaper state across sub-instances of cake_mq")
> Signed-off-by: Shubhang Kaushik (Ampere) <sh@gentwo.org>
> ---
> Tested on an 80-core SMP, non-SMT Ampere Altra system (aarch64)
> The test used a 32-TX-queue veth pair, with cake_mq
> bandwidth 2gbit on the transmit side and the peer in a network
> namespace. The workload was:
>
>   iperf3 -c 198.18.0.2 -P 32 -t 30
>
> Validation against mainline commit a32e63a613aa80, the patched kernel
> reduced cake_configure_rates() calls by 99.99% (2,477,627 to 206) and
> aggregate helper time by 99.986% (3.477 s to 0.498 ms), while retaining
> approximately 1.91 Gbit/s aggregate throughput (baseline:
> 1.91-1.92 Gbit/s). A separate per-child trace observed no
> same-effective-rate calls on the patched kernel (@unchanged: 0).
> Changing cake_mq bandwidth from 2Gbit to 1Gbit and back invoked
> cake_configure_rates() 64 times, matching all 32 child CAKE qdiscs
> updated for each of the two control-plane changes.
>
> Changes in v2:
>   - Drop READ_ONCE() as suggested by Jonas Köppeler.
>
> Link to v1: https://lore.kernel.org/r/20261025-net_sched_sch_cake-v1-1-5165c924a590@gentwo.org

Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>

  reply	other threads:[~2026-10-27  9:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27  4:32 [PATCH v2] net/sched: sch_cake: skip redundant cake_mq rate updates Shubhang Kaushik (Ampere)
2026-10-27  9:55 ` Toke Høiland-Jørgensen [this message]
2026-10-29 11:52 ` Paolo Abeni
2026-10-29 21:45   ` Shubhang

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8733trpix4.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=cake@lists.bufferbloat.net \
    --cc=cl@gentwo.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --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=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sh@gentwo.org \
    --cc=shubhang@os.amperecomputing.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