From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B8BC83000 for ; Tue, 28 Apr 2020 10:18:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0049D206C0 for ; Tue, 28 Apr 2020 10:18:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0049D206C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 52A7C8E0005; Tue, 28 Apr 2020 06:18:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DBD68E0001; Tue, 28 Apr 2020 06:18:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3CA608E0005; Tue, 28 Apr 2020 06:18:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 25F108E0001 for ; Tue, 28 Apr 2020 06:18:28 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D9CB8824805A for ; Tue, 28 Apr 2020 10:18:27 +0000 (UTC) X-FDA: 76756864254.30.stage30_fa303bac6641 X-HE-Tag: stage30_fa303bac6641 X-Filterd-Recvd-Size: 4935 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 28 Apr 2020 10:18:27 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id k12so2105591wmj.3 for ; Tue, 28 Apr 2020 03:18:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qgiXWJlcms+tTPupotLSqm+FPBcp40FxYQcAy22/92c=; b=NObssc23D7L9lJ4Gozf+zeGWfDkWnwcCH3TE49W8Fb2jueUnqCEUdSUVEbsewzxGQO 59II+EIWRL25CFeg25m9uhfUbIG0w8HKsWjWOTwsOlwNPGcGIUIXbod9hsM0d7v9HZJF 88vfe12yFTQSDwU1Dz2tHCaNMlaZesYkbYgD58B9qsiSrmsHG/29e0GQ873bt7aOhcsC c/TJOW2fX1zGOwhEbf9PrB0/KZK2j+F0iGMJwcSimFmLTmmvCgJJQn70/nhB4GdjbLJS 8jVwPWlJKPUqvG9gE3/HfMd8xfSLhJFuox2fXq9KFrc/fNWvzRXsVP8SxlDN4VinC5xV LTqA== X-Gm-Message-State: AGi0PuZs6qrdBkL2sziFpPAG2SpDiKxJAfolUQ9mZ7mMFaumdKLBFusQ 1Zjt/7NKRe+09YpBDgxz+vY= X-Google-Smtp-Source: APiQypKaVlZdmQXw/ZzzWZ6j47uEjNYIq3GhJxratCznfb6J/PNvpcSIoVMkLjM62NOPUvw5xo+LzQ== X-Received: by 2002:a05:600c:22d3:: with SMTP id 19mr3944326wmg.110.1588069106197; Tue, 28 Apr 2020 03:18:26 -0700 (PDT) Received: from localhost (ip-37-188-130-62.eurotel.cz. [37.188.130.62]) by smtp.gmail.com with ESMTPSA id h3sm24489313wrm.73.2020.04.28.03.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 03:18:25 -0700 (PDT) Date: Tue, 28 Apr 2020 12:18:24 +0200 From: Michal Hocko To: Vlastimil Babka Cc: Andrew Morton , Luis Chamberlain , Kees Cook , Iurii Zaikin , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, Ivan Teterevkov , David Rientjes , Matthew Wilcox , "Eric W . Biederman" , "Guilherme G . Piccoli" , Alexey Dobriyan , Thomas Gleixner , Greg Kroah-Hartman , Christian Brauner , Masami Hiramatsu Subject: Re: [PATCH v3 1/5] kernel/sysctl: support setting sysctl parameters from kernel command line Message-ID: <20200428101824.GM28637@dhcp22.suse.cz> References: <20200427180433.7029-1-vbabka@suse.cz> <20200427180433.7029-2-vbabka@suse.cz> <20200427113331.f0c1e8e7cee98644260448d3@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 28-04-20 10:09:37, Vlastimil Babka wrote: > On 4/27/20 8:33 PM, Andrew Morton wrote: > > On Mon, 27 Apr 2020 20:04:29 +0200 Vlastimil Babka wrote: > > > > > ... > > > + 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? Yes, I do agree. I have only recently learned that sysctl supports / as well. Most people are simply used to . notation. The copy of the arch and . -> / substitution is a trivial operation and I do not think it is a real reason to introduce unnecessarily harder to use interface. -- Michal Hocko SUSE Labs