Article View: linux.kernel.netdev
Article #7832Re: [PATCH v2] net/sched: sch_cake: skip redundant cake_mq rate updates
From: Toke Høiland-Jørgensen
Date: Tue, 27 Oct 2026 09:55
Date: Tue, 27 Oct 2026 09:55
52 lines
8977 bytes
8977 bytes
"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>
Technical Details
Message-ID:
<8733trpix4.fsf@toke.dk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352336-linux-kernel-netdev=dewy.ruReferences:
<20261026-net_sched_sch_cake-v2-1-cb1d4e6ed990@gentwo.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352336-linux-kernel-netdev=dewy.ru From: toke@toke.dk (Toke Høiland-Jørgensen) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH v2] net/sched: sch_cake: skip redundant cake_mq rate updates Date: Tue, 27 Oct 2026 10:55:03 +0100 Organization: Usenet Network Message-ID: <8733trpix4.fsf@toke.dk> References: <20261026-net_sched_sch_cake-v2-1-cb1d4e6ed990@gentwo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="1506751"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:57zJZXz/mQjKfY5c6wJGV+c1hUs= sha256:zVeh1FjlUvBtEZUPWw/iifvTE7fNreaPRyJKiDtkfFU= sha1:QAbC+5cNKAVw6ILjmcwYJztmCP4= sha256:qyR5ChdOHcZVFazybm1RFZjK5bFoOCytQ+AynRcW/PI= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 726B0125BE7; Tue, 27 Oct 2026 12:55:35 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.95 X-Spam-Status: No, score=-1.95 tagged_above=-9999 required=6.31 tests=[DKIM_ADSP_ALL=1.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sYP2xYDSxu-H; Tue, 27 Oct 2026 12:55:29 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-352336-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=toke.dk X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 4F6F5125BE6; Tue, 27 Oct 2026 12:55:25 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 41B33601799; Tue, 27 Oct 2026 09:55:24 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793094921; b=hbLHCHcIw8VPfD6SxDsAXeF2QxMsLN+U2j2o5up3fdzJgfxazS0OouKseshfhJBjgIgy cBAOcM3pXqKITXPsnpUlsxZpHPwAyoaNSEIWWZV/SjAtFfnoSEaYAnyO8cn0YLxQOoL3B 98/Fo9critPVmqCMyTtEs3eFdQzhuWVM2R1QV2zAV3MTBaqBks4HE+qFAyH/U4TbntcR7 HVfHwA0Wnrjb0ltcZofVXY+TsqMU0KtUkzSgEfVNNDSeM7ifiT2gdzlMu4M+w1k6OUwOk 3uxZxZokLj69ZnVP5L3AqYNGnUzgaPQBe6Ez3RQcMpfnDkvJHFk0PNi9aYDkT4wUVEw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793094921; h=X-Original-To:Received:DMARC-Filter:From:To:Cc:Subject:In-Reply-To: References:Date:X-Clacks-Overhead:Message-ID:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=7XFJ7wvqPCgNFFCKH1RgMpmXMwr2z/TBkHELQDADOQg=; b=V7LDLd//U3/sbdG/UBKNfRUuVAubpBbmIht8+ZYp+1woTdvL2SAHOxB5NUzeOq8xu2o5 Gmskg/LE1PwOh2Z3C07/jDGy+w1XLiwDVQbctZaqqbOINnWf0rHLZIcCEMZ5PwTq+5Ukx 0qa6IYxLCCa2x3m6r56WZb+9KWLrdNAm0f2uLBxWQ4VGeH3vysYaNIeeCwSRPGSlAbDr4 cX8uj75TS4yDU64DQAFYJz4O1LPed3dFxpoi0v288HBqH6DM9ca0UVXQsvC6u5PdLEDYk Lw+mftjXvYg7L1Xhk/FQhoGdNC9cUv8RDcRvCsNuQ8yTAiFL9UcbAHrRwR7l8bDduRA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=toke.dk; spf=pass smtp.mailfrom=toke.dk; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A894606A324; Tue, 27 Oct 2026 09:55:21 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=45.145.95.4 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793094915; b=c9v0KUa52RrZmxERioxZKo4HEdJm1wexopHSqM17LJCV8MORqc798WqgTeHPP8LKMfWO HeKY5dBX5XzHL5t+CMm4E+G0Vj392vdZF8JZa2WuqzqtlbE8ZCDLfdDu+SuNw21o+NElR n8+cyrZEWRNg8Wu7ShCUTznYT6myOLuH9haoCqBg5ZEYhr3XS50WVj+LyMttvfNP+y8Xl RVE4S30KomjLYvGMHYitlDfVWGCdVpIjwKC1xd+OOAyyJ2GdtX2HPmHpUCNjbbtT8dcA6 CLjQrQ8yuYrTeq/raltFrXm3YWIhx5TCC1AYRen9en2KFB7K/nW7+tPYJqDrNIwkPhg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793094915; h=DMARC-Filter:From:To:Cc:Subject:In-Reply-To:References:Date: X-Clacks-Overhead:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=7XFJ7wvqPCgNFFCKH1RgMpmXMwr2z/TBkHELQDADOQg=; b=mEOu2m7n3aArdMF14kyDaxvS7vCbOGC+QbZrmCsCeowdKifbT6/pG0PynvMlHlWD/3jL R7dx2QW5Pxrh6SJAr10rmtNpb436cJnJMZvfhaCdQyViSyWjO3L4FUREuyV3iN/Ym6tk4 7yvoEV+UAkgYM8aRFe46Y81AGtU2ysihvpDiFzyTEW0xl/q3HY3ml/tD4n32t0VO+weBr +j7NqsRzBZNMN/l6eNBR8Fu2aly9Wj1la7HGuGDOIkhiw/+IeJ24U7211+QnkLllVLQub EDMmkbfhEB5HtXaUKPnJLLDNiK0tcRrOMmBMtLpgR3QelU/0ki+aa1UWcrmZ4XKTZoA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=toke.dk; spf=pass smtp.mailfrom=toke.dk; arc=none smtp.remote-ip=45.145.95.4 X-Received: from mail.toke.dk (mail.toke.dk [45.145.95.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31B3B606A31B; Tue, 27 Oct 2026 09:55:13 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 31B3B606A31B X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=toke.dk X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=toke.dk X-Authentication-Results: mail.toke.dk; dkim=none X-Cc: cake@lists.bufferbloat.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Shubhang Kaushik (Ampere)" <sh@gentwo.org> X-In-Reply-To: <20261026-net_sched_sch_cake-v2-1-cb1d4e6ed990@gentwo.org> X-Clacks-Overhead: GNU Terry Pratchett X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list