From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mail.toke.dk; dkim=none; arc=none (Message is not ARC signed); dmarc=fail (Used From Domain Record) header.from=toke.dk policy.dmarc=none From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: "Shubhang Kaushik (Ampere)" , Jamal Hadi Salim , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jonas =?utf-8?Q?K=C3=B6ppeler?= , Shubhang Kaushik , "Christoph Lameter (Ampere)" Cc: cake@lists.bufferbloat.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Shubhang Kaushik (Ampere)" In-Reply-To: <20261026-net_sched_sch_cake-v2-1-cb1d4e6ed990@gentwo.org> References: <20261026-net_sched_sch_cake-v2-1-cb1d4e6ed990@gentwo.org> Date: Tue, 27 Oct 2026 10:55:03 +0100 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <8733trpix4.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 2R3WMHJVVDJHLP7TKQ5ZEWS7OTJAZ3ME X-Message-ID-Hash: 2R3WMHJVVDJHLP7TKQ5ZEWS7OTJAZ3ME X-MailFrom: toke@toke.dk X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Subject: [Cake] Re: [PATCH v2] net/sched: sch_cake: skip redundant cake_mq rate updates List-Id: Cake - FQ_codel the next generation Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: "Shubhang Kaushik (Ampere)" 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=3Dtrue, 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) > --- > 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=C3=B6ppeler. > > Link to v1: https://lore.kernel.org/r/20261025-net_sched_sch_cake-v1-1-51= 65c924a590@gentwo.org Acked-by: Toke H=C3=B8iland-J=C3=B8rgensen