Merge tag 'sysctl-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Aug 2023 00:39:15 +0000 (17:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Aug 2023 00:39:15 +0000 (17:39 -0700)
Pull sysctl updates from Luis Chamberlain:
 "Long ago we set out to remove the kitchen sink on kernel/sysctl.c
  arrays and placings sysctls to their own sybsystem or file to help
  avoid merge conflicts. Matthew Wilcox pointed out though that if we're
  going to do that we might as well also *save* space while at it and
  try to remove the extra last sysctl entry added at the end of each
  array, a sentintel, instead of bloating the kernel by adding a new
  sentinel with each array moved.

  Doing that was not so trivial, and has required slowing down the moves
  of kernel/sysctl.c arrays and measuring the impact on size by each new
  move.

  The complex part of the effort to help reduce the size of each sysctl
  is being done by the patient work of el seƱor Don Joel Granados. A lot
  of this is truly painful code refactoring and testing and then trying
  to measure the savings of each move and removing the sentinels.
  Although Joel already has code which does most of this work,
  experience with sysctl moves in the past shows is we need to be
  careful due to the slew of odd build failures that are possible due to
  the amount of random Kconfig options sysctls use.

  To that end Joel's work is split by first addressing the major
  housekeeping needed to remove the sentinels, which is part of this
  merge request. The rest of the work to actually remove the sentinels
  will be done later in future kernel releases.

  The preliminary math is showing this will all help reduce the overall
  build time size of the kernel and run time memory consumed by the
  kernel by about ~64 bytes per array where we are able to remove each
  sentinel in the future. That also means there is no more bloating the
  kernel with the extra ~64 bytes per array moved as no new sentinels
  are created"

* tag 'sysctl-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux:
  sysctl: Use ctl_table_size as stopping criteria for list macro
  sysctl: SIZE_MAX->ARRAY_SIZE in register_net_sysctl
  vrf: Update to register_net_sysctl_sz
  networking: Update to register_net_sysctl_sz
  netfilter: Update to register_net_sysctl_sz
  ax.25: Update to register_net_sysctl_sz
  sysctl: Add size to register_net_sysctl function
  sysctl: Add size arg to __register_sysctl_init
  sysctl: Add size to register_sysctl
  sysctl: Add a size arg to __register_sysctl_table
  sysctl: Add size argument to init_header
  sysctl: Add ctl_table_size to ctl_table_header
  sysctl: Use ctl_table_header in list_for_each_table_entry
  sysctl: Prefer ctl_table_header in proc_sysctl

14 files changed:
1  2 
drivers/net/vrf.c
fs/proc/proc_sysctl.c
include/net/ipv6.h
include/net/net_namespace.h
net/ipv4/devinet.c
net/ipv4/route.c
net/ipv4/xfrm4_policy.c
net/ipv6/addrconf.c
net/ipv6/icmp.c
net/ipv6/route.c
net/ipv6/xfrm6_policy.c
net/mptcp/ctrl.c
net/netfilter/ipvs/ip_vs_ctl.c
net/smc/smc_sysctl.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc net/ipv6/icmp.c
Simple merge
Simple merge
Simple merge
index c46c22a84d235bf693e74d3447ef9e12234ab267,43e540328a5252c296c0fca49d68466223344427..e72b518c5d0266f091b61703f371c846b24dae33
@@@ -162,9 -149,9 +162,10 @@@ static int mptcp_pernet_new_table(struc
        table[3].data = &pernet->allow_join_initial_addr_port;
        table[4].data = &pernet->stale_loss_cnt;
        table[5].data = &pernet->pm_type;
 +      table[6].data = &pernet->scheduler;
  
-       hdr = register_net_sysctl(net, MPTCP_SYSCTL_PATH, table);
+       hdr = register_net_sysctl_sz(net, MPTCP_SYSCTL_PATH, table,
+                                    ARRAY_SIZE(mptcp_sysctl_table));
        if (!hdr)
                goto err_reg;
  
Simple merge
Simple merge