Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp578920ybz; Wed, 15 Apr 2020 14:26:14 -0700 (PDT) X-Google-Smtp-Source: APiQypI9o4IowAP29jNwjDtMJWnYPH1xl1T2sMNcfZKu/KwcKNvrK6AujICqOt+fORyUhg+h+GWE X-Received: by 2002:aa7:c3c2:: with SMTP id l2mr5305166edr.362.1586985973932; Wed, 15 Apr 2020 14:26:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586985973; cv=none; d=google.com; s=arc-20160816; b=lKSxRyEMUiNwMvq5MSp0TikyEYFmAdu9sgKpGATeCfix/RDVDYkapQjpyoR3fTNrkQ a7vxRqsWbqDFYZtLhkLWXxFkhbEYTeerX+1rvcv0MxYvd8e8ubrrnC4dO36Ms2UZu2Kx m9w9VEmvxUD4T3/x4QWJr9zP1RMrtJ908H5GDVuaee0QLnU9rSLqz0Hv+Qlfth1lwPKU qsuUr9dD2Th00g3gKUc6dBqXPbytmke5YQKV2Qayxzp85WVFe2SEhpZmZetTZ981jtMd 0MPFu88AszKi/9/JdD4ZDcVVQW87uYfs8wtQJcwuM5p1A5d0VXNTcJFggXvWc+6LxqeD xCMg== 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:mime-version :message-id:date:subject:cc:to:from; bh=kSgcwN7ghC1hBhYqyGAD2LRhHXGoE2rJspOE0QG/ZY8=; b=QD9Q9FxL6CvTjOCKIwC2XlH+kL9QZFj2h6UoMu9hh/dkDj6KlIhsq1kjpOrZvt57gl 1tAsmH4G3G5UiqCCM/vcPqEIym3Yeo6eTi78GekCFeDdAsEIG8Xgnl9fkBMotsR8rMBt pX1pJLhjl6PVTyUTCE4vdoFG7SNYUiEPag0l120sL2mVsMFMxiKiIJVYbO6KKteoJaQl D2bF/9KCfA4I7kD2enG/zZLM0AA0+qw2OtRM4QKj2kavm1lEFCQj1Zxg3abd1iHCnY8j w2SAp8923UoBzg3cScr3XShU6UiURNo3SbDUUhGbpiAuPXX0EFYW9P/ugkHqk/qcXxkU ahdQ== 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 df23si5192990edb.556.2020.04.15.14.25.50; Wed, 15 Apr 2020 14:26:13 -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 S2439273AbgDNLcc (ORCPT + 99 others); Tue, 14 Apr 2020 07:32:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:46546 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438988AbgDNLca (ORCPT ); Tue, 14 Apr 2020 07:32:30 -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 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: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 specific 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(-) -- 2.26.0