Re: [PATCH v3 1/5] kernel/sysctl: support setting sysctl parameters from kernel command line

From
Vlastimil Babka <hidden>
Date
2020-04-28 08:09:42
Also in
linux-mm, lkml
Reply to
Andrew Morton, 2020-04-27
On 4/27/20 8:33 PM, Andrew Morton wrote:
On Mon, 27 Apr 2020 20:04:29 +0200 Vlastimil Babka [off-list ref] wrote:
quoted
...
 
+	sysctl.*=	[KNL]
+			Set a sysctl parameter, right before loading the init
+			process, as if the value was written to the respective
+			/proc/sys/... file. Both '.' and '/' are recognized as
+			separators. Unrecognized parameters and invalid values
+			are reported in the kernel log. Sysctls registered
+			later by a loaded module cannot be set this way.
+			Example: sysctl.vm.swappiness=40
Why support "."?  I think only supporting "/" is perfectly adequate and
simplifies documentation.  It aligns the command-line syntax with the
rest of the sysctl documentation.  I'm not seeing the need to provide
two ways of doing the same thing?
AFAIK the "." is traditional, and "/" is a newer artefact of moving from the binary syscall form to procfs based form. So by "command-line syntax" you mean echo and cat, not sysctl tool? Because "man sysctl" says:

variable
	The name of a key to read from.  An example is kernel.ostype.  The '/' separator is also accepted in place of a '.'.

So I'm not strongly against supporting only / but I expect most people are used to the . and it will take them two attempts to pass the sysctl boot parameter correctly if they don't use it regularly - first trying . form, wonder why it doesn't work, then read the doc and realize it's not supported?

Vlastimil
Thread (17 messages) 17 messages, 4 authors, last reply 2020-05-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help