The purpose of this patch series is to enable easy addition of newauxillary sysctl parameters that can be read to display ranges ofother sysctl parameters they are associated with.

With this patch series applied, a developer can add a range-showingauxillary sysctl entries by just setting the CTL_FLAGS_SHOW_RANGEflag in the ctl_table entry that has a range to show and add one moreto the number of reserved range entries in the CTL_RESERVE_RANGES()macro before the terminating null entry. The new auxillary sysctlparameters will have the "_range" suffix added.

The number of ctl_table entries that have the CTL_FLAGS_SHOW_RANGE flagshould match the number of reserved entries in the CTL_RESERVE_RANGES()macro. Otherwise, warning or error like below will be logged in thekernel ring buffer.

Warning: Too many reserved ctl_table range entries ("shmmax")!

Error: Insufficient reserved ctl_table range entries ("shmmax")!

The IPC sysctl parameters msgmni and shmmni are extended to havethose auxillary sysctl entries. As a result, one can now find outthe range of allowable value by looking at the correspondingauxillary _range sysctl parameters. For example,

% cat msgmni_range [0, 32768]

That means the msgmni sysctl parameter has to be within the 0 - 32768range inclusively.

Patch 1 clarifies how the ctl_table.flags field should be used.

Patch 2 adds a new proc_show_minmax() handler to display a min/maxrange.

Patch 3 defines the new CTL_FLAGS_SHOW_RANGE flag and theCTL_RESERVE_RANGES() macro.

Patch 5 extends msgmni and shmmni to have their corresponding rangeshowing sysctl parameters.

Waiman Long (5): sysctl: Clarify how the ctl_table.flags should be set sysctl: Add a new handler proc_show_minmax() sysctl: Add a new ctl_table flag to show min/max range proc/sysctl: Handle CTL_FLAGS_SHOW_RANGE ctl_table flag ipc: Show ranges of msgmni and shmmni with CTL_FLAGS_SHOW_RANGE