• Linus Torvalds's avatar
    Merge tag 'sysctl-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux · 888d3c9f
    Linus Torvalds authored
    Pull sysctl updates from Luis Chamberlain:
     "This only does a few sysctl moves from the kernel/sysctl.c file, the
      rest of the work has been put towards deprecating two API calls which
      incur recursion and prevent us from simplifying the registration
      process / saving memory per move. Most of the changes have been
      soaking on linux-next since v6.3-rc3.
    
      I've slowed down the kernel/sysctl.c moves due to Matthew Wilcox's
      feedback that we should see if we could *save* memory with these moves
      instead of incurring more memory. We currently incur more memory since
      when we move a syctl from kernel/sysclt.c out to its own file we end
      up having to add a new empty sysctl used to register it. To achieve
      saving memory we want to allow syctls to be passed without requiring
      the end element being empty, and just have our registration process
      rely on ARRAY_SIZE(). Without this, supporting both styles of sysctls
      would make the sysctl registration pretty brittle, hard to read and
      maintain as can be seen from Meng Tang's efforts to do just this [0].
      Fortunately, in order to use ARRAY_SIZE() for all sysctl registrations
      also implies doing the work to deprecate two API calls which use
      recursion in order to support sysctl declarations with subdirectories.
    
      And so during this development cycle quite a bit of effort went into
      this deprecation effort. I've annotated the following two APIs are
      deprecated and in few kernel releases we should be good to remove
      them:
    
       - register_sysctl_table()
       - register_sysctl_paths()
    
      During this merge window we should be able to deprecate and unexport
      register_sysctl_paths(), we can probably do that towards the end of
      this merge window.
    
      Deprecating register_sysctl_table() will take a bit more time but this
      pull request goes with a few example of how to do this.
    
      As it turns out each of the conversions to move away from either of
      these two API calls *also* saves memory. And so long term, all these
      changes *will* prove to have saved a bit of memory on boot.
    
      The way I see it then is if remove a user of one deprecated call, it
      gives us enough savings to move one kernel/sysctl.c out from the
      generic arrays as we end up with about the same amount of bytes.
    
      Since deprecating register_sysctl_table() and register_sysctl_paths()
      does not require maintainer coordination except the final unexport
      you'll see quite a bit of these changes from other pull requests, I've
      just kept the stragglers after rc3"
    
    Link: https://lkml.kernel.org/r/ZAD+cpbrqlc5vmry@bombadil.infradead.org [0]
    
    * tag 'sysctl-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: (29 commits)
      fs: fix sysctls.c built
      mm: compaction: remove incorrect #ifdef checks
      mm: compaction: move compaction sysctl to its own file
      mm: memory-failure: Move memory failure sysctls to its own file
      arm: simplify two-level sysctl registration for ctl_isa_vars
      ia64: simplify one-level sysctl registration for kdump_ctl_table
      utsname: simplify one-level sysctl registration for uts_kern_table
      ntfs: simplfy one-level sysctl registration for ntfs_sysctls
      coda: simplify one-level sysctl registration for coda_table
      fs/cachefiles: simplify one-level sysctl registration for cachefiles_sysctls
      xfs: simplify two-level sysctl registration for xfs_table
      nfs: simplify two-level sysctl registration for nfs_cb_sysctls
      nfs: simplify two-level sysctl registration for nfs4_cb_sysctls
      lockd: simplify two-level sysctl registration for nlm_sysctls
      proc_sysctl: enhance documentation
      xen: simplify sysctl registration for balloon
      md: simplify sysctl registration
      hv: simplify sysctl registration
      scsi: simplify sysctl registration with register_sysctl()
      csky: simplify alignment sysctl registration
      ...
    888d3c9f
md.c 260 KB