]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/sched: cake: avoid separate allocation of struct cake_sched_config
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 13 Jan 2026 14:31:56 +0000 (15:31 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 17 Jan 2026 23:30:28 +0000 (15:30 -0800)
commit2a85541d95f7b791a8547ea1c2e22d214278079d
tree765e1621c1230c28180bc246c2efa175ea3b16cc
parent8fc807104125428be6b2ac9c3f210d0f69e055be
net/sched: cake: avoid separate allocation of struct cake_sched_config

Paolo pointed out that we can avoid separately allocating struct
cake_sched_config even in the non-mq case, by embedding it into struct
cake_sched_data. This reduces the complexity of the logic that swaps the
pointers and frees the old value, at the cost of adding 56 bytes to the
latter. Since cake_sched_data is already almost 17k bytes, this seems
like a reasonable tradeoff.

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Fixes: bc0ce2bad36c ("net/sched: sch_cake: Factor out config variables into separate struct")
Link: https://patch.msgid.link/20260113143157.2581680-1-toke@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_cake.c