Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3844662ybz; Tue, 28 Apr 2020 01:12:05 -0700 (PDT) X-Google-Smtp-Source: APiQypLhBLp2qk3tiD/XcgNNuOh0LC4iVZpdKJxWeEuyJBLoLFuQnzqt0jZ8mis9ZK1sXEJGRS2s X-Received: by 2002:a50:c3c2:: with SMTP id i2mr22300922edf.227.1588061525199; Tue, 28 Apr 2020 01:12:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588061525; cv=none; d=google.com; s=arc-20160816; b=NvKthbW3qL5J7JzAaN3CEeCpBWmN1KKo2AFe+Z5nSRqjnZfaEd+i2AipApXmwSpJNB eYitecXYbnG5d+Vbu5wZPCbCri1tOmyeADa0KckrjQhDdXU2GhfAEVB4Pfh12kPlYCJY 6dqmQZlMyV0hzr8KLI7RnG9ZoCu3nl6uS2wW5H5ViIBbvja3UbVo+YIuf5tfhB+HSi1k luS9L7zplV5ZBp/KVjKzmR03HEzYkgP0Qyorrpp6c8hWYrQG0mHx/YKCVAVcNGdXf0bR VhmxiRxJtQoTkA91zTn6sj8PeA26FLP+t5euYThde4C6CCdZxlMlYzvkUQGkcM1TklxO yaTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=AEgoDy4Foak9XrgNsc5fLWmu0Ph1I8IeT4hdkk9yHik=; b=Mgl02j+mt1+S84US9qf+NuHjoneQb21UkuCtT1L5XE7z7zJc1LY8p45ctoTpsnd/BC kYgpHEKCpD/+Ma4HEYac3jRFOx1z7G1408OwvYNIg7kpwD23TNfFoMatGAAsNW3L6G/G F4zInP+RymWIUDk2l5NEIzKaymgAcV9Ye/VMGWto+9prKMFeZgyW8uG13wbi857S/SPB u4mO/0f329mGw55MuaoZj9OAHqRSGpfh1WABIQgoqNDq0oT6OGy7575IkGG97rLujk7F x8vOWWgb90sLb91S9SChVdpqffuCf+z+osUIoGCCwCALwe48SdbC/NVHIqMQAp23TwvC vq4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ly5si1409748ejb.180.2020.04.28.01.11.41; Tue, 28 Apr 2020 01:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbgD1IJl (ORCPT + 99 others); Tue, 28 Apr 2020 04:09:41 -0400 Received: from mx2.suse.de ([195.135.220.15]:50810 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbgD1IJl (ORCPT ); Tue, 28 Apr 2020 04:09:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DF892AD0E; Tue, 28 Apr 2020 08:09:37 +0000 (UTC) Subject: Re: [PATCH v3 1/5] kernel/sysctl: support setting sysctl parameters from kernel command line To: Andrew Morton Cc: Luis Chamberlain , Kees Cook , Iurii Zaikin , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-mm@kvack.org, Ivan Teterevkov , Michal Hocko , David Rientjes , Matthew Wilcox , "Eric W . Biederman" , "Guilherme G . Piccoli" , Alexey Dobriyan , Thomas Gleixner , Greg Kroah-Hartman , Christian Brauner , Masami Hiramatsu , Michal Hocko References: <20200427180433.7029-1-vbabka@suse.cz> <20200427180433.7029-2-vbabka@suse.cz> <20200427113331.f0c1e8e7cee98644260448d3@linux-foundation.org> From: Vlastimil Babka Message-ID: Date: Tue, 28 Apr 2020 10:09:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200427113331.f0c1e8e7cee98644260448d3@linux-foundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Vlastimil