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: Jonas =?utf-8?Q?K=C3=B6ppeler?= , Jamal Hadi Salim , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman Cc: cake@lists.bufferbloat.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jonas =?utf-8?Q?K=C3=B6ppeler?= , Mike Pham In-Reply-To: <20260716-sch_cake-skip-clearing-tins-v1-1-d9787df20c28@tu-berlin.de> References: <20260716-sch_cake-skip-clearing-tins-v1-1-d9787df20c28@tu-berlin.de> Date: Fri, 17 Jul 2026 10:31:37 +0200 X-Clacks-Overhead: GNU Terry Pratchett Message-ID: <87wluuj9ue.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: QW4SGBD6F7TR7Q3UNTICCFW4DWNS7OAL X-Message-ID-Hash: QW4SGBD6F7TR7Q3UNTICCFW4DWNS7OAL 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 net-next] net/sched: sch_cake: skip clearing unused tins during rate adjustment List-Id: Cake - FQ_codel the next generation Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Jonas K=C3=B6ppeler writes: > When cake_configure_rates() is called from the dequeue path with > rate_adjust=3Dtrue, 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. > > Fixes: 15c2715a5264 ("net/sched: sch_cake: fixup cake_mq rate adjustment = for diffserv config") > Signed-off-by: Jonas K=C3=B6ppeler > Tested-by: Mike Pham Do you have any performance numbers to show the impact of this? -Toke