All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] sysctl: Enable easy addition of range showing sysctl parameters
@ 2018-03-07 20:34 Waiman Long
  2018-03-07 20:34 ` [PATCH 1/5] sysctl: Clarify how the ctl_table.flags should be set Waiman Long
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Waiman Long @ 2018-03-07 20:34 UTC (permalink / raw)
  To: Luis R. Rodriguez, Kees Cook
  Cc: linux-kernel, linux-fsdevel, Andrew Morton, Al Viro,
	Matthew Wilcox, Waiman Long

This patch series is to be applied on top of the patch
series "ipc: Clamp *mni to the real IPCMNI limit"
(https://lkml.org/lkml/2018/3/1/716).

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

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

The number of ctl_table entries that have the CTL_FLAGS_SHOW_RANGE flag
should match the number of reserved entries in the CTL_RESERVE_RANGES()
macro. Otherwise, warning or error like below will be logged in the
kernel 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 have
those auxillary sysctl entries. As a result, one can now find out
the range of allowable value by looking at the corresponding
auxillary _range sysctl parameters. For example,

  % cat msgmni_range
  [0, 32768]

That means the msgmni sysctl parameter has to be within the 0 - 32768
range 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/max
range.

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

Patch 4 modifies the proc_sysctl.c file to handle the
CTL_FLAGS_SHOW_RANGE in ctl_table registration and un-registration.

Patch 5 extends msgmni and shmmni to have their corresponding range
showing 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

 fs/proc/proc_sysctl.c  | 99 +++++++++++++++++++++++++++++++++++++++++++++++---
 include/linux/sysctl.h | 52 +++++++++++++++++++++++++-
 ipc/ipc_sysctl.c       |  5 ++-
 kernel/sysctl.c        | 91 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 238 insertions(+), 9 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-03-08 19:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07 20:34 [PATCH 0/5] sysctl: Enable easy addition of range showing sysctl parameters Waiman Long
2018-03-07 20:34 ` [PATCH 1/5] sysctl: Clarify how the ctl_table.flags should be set Waiman Long
2018-03-07 20:34 ` [PATCH 2/5] sysctl: Add a new handler proc_show_minmax() Waiman Long
2018-03-07 20:34 ` [PATCH 3/5] sysctl: Add a new ctl_table flag to show min/max range Waiman Long
2018-03-07 20:34 ` [PATCH 4/5] proc/sysctl: Handle CTL_FLAGS_SHOW_RANGE ctl_table flag Waiman Long
2018-03-07 20:34 ` [PATCH 5/5] ipc: Show ranges of msgmni and shmmni with CTL_FLAGS_SHOW_RANGE Waiman Long
2018-03-07 22:48 ` [PATCH 0/5] sysctl: Enable easy addition of range showing sysctl parameters Andrew Morton
2018-03-08 19:21   ` Waiman Long
2018-03-08 18:34 ` Luis R. Rodriguez
2018-03-08 19:11   ` Waiman Long

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.