Linux 6.10 Goes Ahead In Removing Sysctl Sentinel Bloat
Over the past year there's been much work happening within the Linux kernel's sysctl code for 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 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 queued this past week.
That merge goes on to summarize:
Nice to see this sysctl sentinel clearing work culminating after the lengthy effort over the past year.
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 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.
10 Comments