Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2363492ybb; Mon, 30 Mar 2020 04:57:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsw23F3oDVKn9d45lqE2/8/OsYbmZdgXQRggwb8Os4rMqNHgUTllDgFEZSCL0SBqMCm+UXi X-Received: by 2002:a4a:874f:: with SMTP id a15mr9193658ooi.8.1585569422155; Mon, 30 Mar 2020 04:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585569422; cv=none; d=google.com; s=arc-20160816; b=jCpZPs7Ggn/S1gjalN+Wav364eDvF9VVEneNl2KlB/sLFvHsPPrf0HhZjzAQfvfPUN WUCTfn1WsYe3u3cIIIHVrLYuH4FCOeeI2gRQmDvpFbGO32frMZDINxu5VV34PcPTsoeA kncvtqbYOoAi+FJFEWvOcyKtJEEK8XUZKuLoDnmjknAj2i7a+NSMgs64GI9rxB5vIsX5 m6QBXK1XZ9MCWGWd5QWh8vrc8EbiZCZt8auDeyg/xs7X225h45QXZN3uHpIOk8Tn/kCX V7P9ng+Z02cWgGPMAiec2jlOSk3x0222GtNl+uKhAmGqyVUTdSNxNJplc/H2z6GCdWcI yDLw== 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=7i+P1ZTvc1kBaN0+GiM+JtXF8JnwsMKFviY/yZpVHOc=; b=Gjl3sKFKReuOyxeHcDQv0bnPocv6dsMto2g7p5hVQOxMAG8NR+csfYJcWIwNjwyieG /noA5bXdPi4kEGQTZnvh1/5fZmKei+eoejdFNfy1PQD4YNLQQtXlJeBYVxfbAEqeyPaB hxbzrcv0gAlZ1pSAUOtlz3FrtPVvVSNonkA0uMbWAWvHjWBeqbVFj+/usphzuB6ftzQ2 16AIWFqqE8yUmjJdIhfgv2KeZSZOHJtjXpvJ0xtL1sONq/mOCi5WJfbdqZkoe9hNvHHR Cy1chHPBPy0bJGOAPTYHr6JOOui+ErmJJ/1G0zYAhNRr7PZw2frekzfIsPJlVL8Za6YZ musg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e11si5691276oib.152.2020.03.30.04.56.48; Mon, 30 Mar 2020 04:57:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730068AbgC3Lzz (ORCPT + 99 others); Mon, 30 Mar 2020 07:55:55 -0400 Received: from mx2.suse.de ([195.135.220.15]:51586 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730052AbgC3Lzz (ORCPT ); Mon, 30 Mar 2020 07:55:55 -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 A8C2DAD11; Mon, 30 Mar 2020 11:55:52 +0000 (UTC) From: Vlastimil Babka To: 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 , Vlastimil Babka Subject: [PATCH 0/3] support setting sysctl parameters from kernel command line Date: Mon, 30 Mar 2020 13:55:32 +0200 Message-Id: <20200330115535.3215-1-vbabka@suse.cz> X-Mailer: git-send-email 2.25.1 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 Anyway I hope that Patch 1 is mature enough to go regardless of the fate of the less important second part. Changes since RFCv2 - make proc_mnt internal to functions (Kees) - use kasprintf when building path (Kees) - improve error reporting - common errnos are translated to more obvious messages and the rest uses %pe 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 .../admin-guide/kernel-parameters.txt | 11 +- fs/proc/proc_sysctl.c | 135 ++++++++++++++++++ include/linux/sysctl.h | 4 + init/main.c | 2 + kernel/hung_task.c | 10 -- mm/page_alloc.c | 9 -- 6 files changed, 151 insertions(+), 20 deletions(-) -- 2.25.1