]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/sched: sch_cake: share shaper state across sub-instances of cake_mq
authorJonas Köppeler <j.koeppeler@tu-berlin.de>
Fri, 9 Jan 2026 13:15:34 +0000 (14:15 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 13 Jan 2026 10:54:29 +0000 (11:54 +0100)
commit1bddd758bac21fbbd8a06af746ec7b6d878a9d2c
treebaab399c0e2a912fe31f92c684ae81c0d3f873e2
parent87826c01837c314c3caada33524fc769e58364a9
net/sched: sch_cake: share shaper state across sub-instances of cake_mq

This commit adds shared shaper state across the cake instances beneath a
cake_mq qdisc. It works by periodically tracking the number of active
instances, and scaling the configured rate by the number of active
queues.

The scan is lockless and simply reads the qlen and the last_active state
variable of each of the instances configured beneath the parent cake_mq
instance. Locking is not required since the values are only updated by
the owning instance, and eventual consistency is sufficient for the
purpose of estimating the number of active queues.

The interval for scanning the number of active queues is set to 200 us.
We found this to be a good tradeoff between overhead and response time.
For a detailed analysis of this aspect see the Netdevconf talk:

https://netdevconf.info/0x19/docs/netdev-0x19-paper16-talk-paper.pdf

Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20260109-mq-cake-sub-qdisc-v8-5-8d613fece5d8@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Documentation/netlink/specs/tc.yaml
include/uapi/linux/pkt_sched.h
net/sched/sch_cake.c