From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: "Toke Høiland-Jørgensen" <toke@toke.dk>,
"Jamal Hadi Salim" <jhs@mojatatu.com>,
"Cong Wang" <xiyou.wangcong@gmail.com>,
"Jiri Pirko" <jiri@resnulli.us>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>
Cc: "Jonas Köppeler" <j.koeppeler@tu-berlin.de>,
cake@lists.bufferbloat.net, netdev@vger.kernel.org,
"Toke Høiland-Jørgensen" <toke@redhat.com>
Subject: [Cake] [PATCH net-next v4 0/5] Multi-queue aware sch_cake
Date: Mon, 01 Dec 2025 11:00:18 +0100 [thread overview]
Message-ID: <20251201-mq-cake-sub-qdisc-v4-0-50dd3211a1c6@redhat.com> (raw)
This series adds a multi-queue aware variant of the sch_cake scheduler,
called 'cake_mq'. Using this makes it possible to scale the rate shaper
of sch_cake across multiple CPUs, while still enforcing a single global
rate on the interface.
The approach taken in this patch series is to implement a separate qdisc
called 'cake_mq', which is based on the existing 'mq' qdisc, but differs
in a couple of aspects:
- It will always install a cake instance on each hardware queue (instead
of using the default qdisc for each queue like 'mq' does).
- The cake instances on the queues will share their configuration, which
can only be modified through the parent cake_mq instance.
Doing things this way simplifies user configuration by centralising
all configuration through the cake_mq qdisc (which also serves as an
obvious way of opting into the multi-queue aware behaviour). The cake_mq
qdisc takes all the same configuration parameters as the cake qdisc.
An earlier version of this work was presented at this year's Netdevconf:
https://netdevconf.info/0x19/sessions/talk/mq-cake-scaling-software-rate-limiting-across-cpu-cores.html
The patch series is structured as follows:
- Patch 1 exports the mq qdisc functions for reuse.
- Patch 2 factors out the sch_cake configuration variables into a
separate struct that can be shared between instances.
- Patch 3 adds the basic cake_mq qdisc, reusing the exported mq code
- Patch 4 adds configuration sharing across the cake instances installed
under cake_mq
- Patch 5 adds the shared shaper state that enables the multi-core rate
shaping
A selftest, and a patch to iproute2 to make it aware of the cake_mq
qdisc, will be submitted separately.
---
Changes in v4:
- A bunch of bot nits:
- Fix null pointer deref in cake_destroy()
- Unwind qdisc registration on failure
- Use rcu_dereference() instead of rtnl_dereference() in data path
- Use WRITE_ONCE() for q->last_active
- Store num_active_qs to stats value after computing it
- Link to v3: https://lore.kernel.org/r/20251130-mq-cake-sub-qdisc-v3-0-5f66c548ecdc@redhat.com
Changes in v3:
- Export the functions from sch_mq and reuse them instead of copy-pasting
- Dropped Jamal's reviewed-by on the patches that changed due to the above
- Fixed a crash if cake_mq_init is called with a NULL opt parameter
- Link to v2: https://lore.kernel.org/r/20251127-mq-cake-sub-qdisc-v2-0-24d9ead047b9@redhat.com
Changes in v2:
- Rebase on top of net-next, incorporating Eric's changes
- Link to v1: https://lore.kernel.org/r/20251124-mq-cake-sub-qdisc-v1-0-a2ff1dab488f@redhat.com
Changes in v1 (since RFC):
- Drop the sync_time parameter for now and always use the 200 us value.
We are planning to explore auto-configuration of the sync time, so
this is to avoid committing to a UAPI. If needed, a parameter can be
added back later.
- Keep the tc yaml spec in sync with the new stats member
- Rebase on net-next
- Link to RFC: https://lore.kernel.org/r/20250924-mq-cake-sub-qdisc-v1-0-43a060d1112a@redhat.com
---
Jonas Köppeler (1):
net/sched: sch_cake: share shaper state across sub-instances of cake_mq
Toke Høiland-Jørgensen (4):
net/sched: Export mq functions for reuse
net/sched: sch_cake: Factor out config variables into separate struct
net/sched: sch_cake: Add cake_mq qdisc for using cake on mq devices
net/sched: sch_cake: Share config across cake_mq sub-qdiscs
Documentation/netlink/specs/tc.yaml | 3 +
include/net/sch_generic.h | 19 ++
include/uapi/linux/pkt_sched.h | 1 +
net/sched/sch_cake.c | 485 ++++++++++++++++++++++++++----------
net/sched/sch_mq.c | 69 +++--
5 files changed, 431 insertions(+), 146 deletions(-)
---
base-commit: 0177f0f07886e54e12c6f18fa58f63e63ddd3c58
change-id: 20250902-mq-cake-sub-qdisc-cdf0b59d2fe5
next reply other threads:[~2025-12-01 10:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 10:00 Toke Høiland-Jørgensen [this message]
2025-12-01 10:00 ` [Cake] [PATCH net-next v4 1/5] net/sched: Export mq functions for reuse Toke Høiland-Jørgensen
2025-12-01 10:00 ` [Cake] [PATCH net-next v4 2/5] net/sched: sch_cake: Factor out config variables into separate struct Toke Høiland-Jørgensen
2025-12-01 10:00 ` [Cake] [PATCH net-next v4 3/5] net/sched: sch_cake: Add cake_mq qdisc for using cake on mq devices Toke Høiland-Jørgensen
2025-12-01 10:00 ` [Cake] [PATCH net-next v4 4/5] net/sched: sch_cake: Share config across cake_mq sub-qdiscs Toke Høiland-Jørgensen
2025-12-01 10:00 ` [Cake] [PATCH net-next v4 5/5] net/sched: sch_cake: share shaper state across sub-instances of cake_mq Toke Høiland-Jørgensen
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
List information: https://lists.bufferbloat.net/postorius/lists/cake.lists.bufferbloat.net/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251201-mq-cake-sub-qdisc-v4-0-50dd3211a1c6@redhat.com \
--to=toke@redhat.com \
--cc=cake@lists.bufferbloat.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=j.koeppeler@tu-berlin.de \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=toke@toke.dk \
--cc=xiyou.wangcong@gmail.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