News: 0001462588

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linux 6.10 Goes Ahead In Removing Sysctl Sentinel Bloat

([Linux Kernel] 5 Hours Ago Savings Per Array)


Over the past year there's been much work happening within the Linux kernel's sysctl code for [1]clearing up ~64 bytes of bloat per array throughout the kernel by dropping the last sysctl "sentinel" entry at the end of each array. This also helps in reducing the build time of the kernel and is [2]a nice improvement . With Linux 6.10, the sysctl sentinel clearing throughout different subsystems is set to happen.

Clearing out the the last empty element on each sysctl array is finally happening. For example, the sysctl sentinel removal in the networking subsystem was [3]queued this past week.

That merge goes on to summarize:

Why?

By removing the sysctl sentinel elements we avoid kernel bloat as ctl_table arrays get moved out of kernel/sysctl.c into their own

respective subsystems. This move was started long ago to avoid merge conflicts; the sentinel removal bit came after Mathew Wilcox suggested it to avoid bloating the kernel by one element as arrays moved out. This patchset will reduce the overall build time size of the kernel and run time memory bloat by about ~64 bytes per declared ctl_table array.

...

Savings in vmlinux:

A total of 64 bytes per sentinel is saved after removal; I measured in x86_64 to give an idea of the aggregated savings. The actual savings will depend on individual kernel configuration.

* bloat-o-meter

- The "yesall" config saves 3976 bytes

- A reduced config saves 1263 bytes

Savings in allocated memory:

None in this set but will occur when the superfluous allocations are removed from proc_sysctl.c. I include it here for context. The estimated savings during boot for config are 6272 bytes.

Nice to see this sysctl sentinel clearing work culminating after the lengthy effort over the past year.



[1] https://www.phoronix.com/news/Linux-6.6-Sysctl-Cleaning

[2] https://www.phoronix.com/news/Linux-6.8-sysctl

[3] https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git/commit/?id=5829614a7b3b2cc9820efb2d29a205c00d748fcf



rene

Kjell

ultimA

rene

npwx

...his disciples lead him in; he just does the rest.
-- The Who, "Tommy"