support setting sysctl parameters from kernel command line
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 11 repliesIn review 4 of 5 applied
- v23 patches 15 repliesSuperseded
- v13 patches 28 repliesSuperseded
Changes in v3 from the cover letter
- rebase to 5.7-rc3
- add acks
- add a testcase to tools/testing/selftests/sysctl/sysctl.sh - this adds a new sysctl parameter ../boot_int in lib/test_sysctl and expects the tester to pass the respective boot parameter in any feasible way (including bootconfig) the testcase checks /proc/cmdline to distinguish real failure from the lack of parameter. That allows us to test this without introducing further new functionality (patches 4+5).
Patches in v3 4 of 5 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | kernel/sysctl: support setting sysctl parameters from kernel command lineDocumentation/ fs/ include/ +1 more | +122 | 3 replies | Applied |
| 2/5 | kernel/sysctl: support handling command line aliasesfs/ mm/ | +41 | 0 replies | Applied |
| 3/5 | kernel/hung_task convert hung_task_panic boot parameter to sysctlDocumentation/ fs/ kernel/ | +2 | 0 replies | Applied |
| 4/5 | tools/testing/selftests/sysctl/sysctl.sh: support CONFIG_TEST_SYSCTL=ytools/ | +3 | 1 reply | Applied |
| 5/5 | lib/test_sysctl: support testing of sysctl. boot parameterlib/ tools/ | +49 | 7 replies |
Reviews trailers per patch
4 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Kees Cook | Michal Hocko | Luis Chamberlain | Masami Hiramatsu |
|---|---|---|---|---|
| 1/5 | A-b | A-b | R-b | R-b |
| 2/5 | A-b | A-b | R-b | |
| 3/5 | R-b | A-b | ||
| 4/5 | A-b | |||
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v3 0/5] support setting sysctl parameters from kernel command line
This series adds support for something that seems like many people always wanted but nobody added it yet, so here's the ability to set sysctl parameters via kernel command line options in the form of sysctl.vm.something=1
The important part is Patch 1. The second, not so important part is an attempt to clean up legacy one-off parameters that do the same thing as a sysctl. I don't want to remove them completely for compatibility reasons, but with generic sysctl support the idea is to remove the one-off param handlers and treat the parameters as aliases for the sysctl variants.
I have identified several parameters that mention sysctl counterparts in Documentation/admin-guide/kernel-parameters.txt but there might be more. The conversion also has varying level of success:
- numa_zonelist_order is converted in Patch 2 together with adding the necessary infrastructure. It's easy as it doesn't really do anything but warn on deprecated value these days.
- hung_task_panic is converted in Patch 3, but there's a downside that now it only accepts 0 and 1, while previously it was any integer value
- nmi_watchdog maps to two sysctls nmi_watchdog and hardlockup_panic, so there's no straighforward conversion possible
- traceoff_on_warning is a flag without value and it would be required to handle that somehow in the conversion infractructure, which seems pointless for a single flag
Vlastimil Babka (3):
kernel/sysctl: support setting sysctl parameters from kernel command
line
kernel/sysctl: support handling command line aliases kernel/hung_task convert hung_task_panic boot parameter to sysctl
Changes since v2:
- rebase to 5.7-rc3
- add acks
- add a testcase to tools/testing/selftests/sysctl/sysctl.sh - this adds a new sysctl parameter ../boot_int in lib/test_sysctl and expects the tester to pass the respective boot parameter in any feasible way (including bootconfig) the testcase checks /proc/cmdline to distinguish real failure from the lack of parameter. That allows us to test this without introducing further new functionality (patches 4+5).
Vlastimil Babka (5):
kernel/sysctl: support setting sysctl parameters from kernel command
line
kernel/sysctl: support handling command line aliases kernel/hung_task convert hung_task_panic boot parameter to sysctl tools/testing/selftests/sysctl/sysctl.sh: support CONFIG_TEST_SYSCTL=y lib/test_sysctl: support testing of sysctl. boot parameter
.../admin-guide/kernel-parameters.txt | 11 +- fs/proc/proc_sysctl.c | 142 ++++++++++++++++++ include/linux/sysctl.h | 4 + init/main.c | 2 + kernel/hung_task.c | 10 -- lib/test_sysctl.c | 13 ++ mm/page_alloc.c | 9 -- tools/testing/selftests/sysctl/sysctl.sh | 42 +++++- 8 files changed, 210 insertions(+), 23 deletions(-)
Signature · 1 line
2.26.0