]> git.dujemihanovic.xyz Git - linux.git/commit
sch_cake: constify inverse square root cache
authorDave Taht <dave.taht@gmail.com>
Mon, 9 Sep 2024 09:16:28 +0000 (11:16 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Sep 2024 01:31:52 +0000 (18:31 -0700)
commitc48994baefdc1e092d1ebd979ae573e73fcfb9c5
treeadb4d9a5a1db5d16e87e289bac2dd2ad704d6e5a
parent3f464b193d40e49299dcd087b10cc3b77cbbea68
sch_cake: constify inverse square root cache

sch_cake uses a cache of the first 16 values of the inverse square root
calculation for the Cobalt AQM to save some cycles on the fast path.
This cache is populated when the qdisc is first loaded, but there's
really no reason why it can't just be pre-populated. So change it to be
pre-populated with constants, which also makes it possible to constify
it.

This gives a modest space saving for the module (not counting debug data):
.text:  -224 bytes
.rodata: +80 bytes
.bss:    -64 bytes
Total:  -192 bytes

Signed-off-by: Dave Taht <dave.taht@gmail.com>
[ fixed up comment, rewrote commit message ]
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20240909091630.22177-1-toke@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sched/sch_cake.c