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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 F077DC2BA19 for ; Tue, 14 Apr 2020 11:32:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B3B34206D5 for ; Tue, 14 Apr 2020 11:32:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3B34206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 614308E0001; Tue, 14 Apr 2020 07:32:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 262828E000B; Tue, 14 Apr 2020 07:32:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE0328E0006; Tue, 14 Apr 2020 07:32:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0065.hostedemail.com [216.40.44.65]) by kanga.kvack.org (Postfix) with ESMTP id C07808E0005 for ; Tue, 14 Apr 2020 07:32:30 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7A1DC52AD for ; Tue, 14 Apr 2020 11:32:30 +0000 (UTC) X-FDA: 76706247660.10.tray02_8a3f182290817 X-HE-Tag: tray02_8a3f182290817 X-Filterd-Recvd-Size: 3834 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Apr 2020 11:32:29 +0000 (UTC) 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 0FBFBADB5; Tue, 14 Apr 2020 11:32:27 +0000 (UTC) From: Vlastimil Babka To: Andrew Morton , Luis Chamberlain , Kees Cook , Iurii Zaikin Cc: 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 , Vlastimil Babka Subject: [PATCH v2 0/3] support setting sysctl parameters from kernel command line Date: Tue, 14 Apr 2020 13:32:19 +0200 Message-Id: <20200414113222.16959-1-vbabka@suse.cz> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: 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 param= eters via kernel command line options in the form of sysctl.vm.something=3D1 The important part is Patch 1. The second, not so important part is an at= tempt 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 wit= h generic sysctl support the idea is to remove the one-off param handlers a= nd 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 bu= t warn on deprecated value these days. - hung_task_panic is converted in Patch 3, but there's a downside that no= w 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 point= less 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 v1: - add missing newlines on printk's - more adjustments to proc mount param passing (Kees) - rebase to 5.7-rc1 - add acks/reviews - test driver (how to pass a testing boot parameter without bootloader sp= ecific steps) still under discussion - new Kconfig? bootconfig? .../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 -- mm/page_alloc.c | 9 -- 6 files changed, 158 insertions(+), 20 deletions(-) --=20 2.26.0