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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 51C4FC2BA2B for ; Thu, 16 Apr 2020 06:08:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E4A9214AF for ; Thu, 16 Apr 2020 06:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587017335; bh=UbzFaYMrN1j2xemeLV2+pIN8pGIBq/3wkSPSZQ0MtR8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=X/0QWfzFEkeTJNc+BaxJ3pviqoM0GIk76T6PXBXypebMfqe2xlbCb05K5z/zBJ0fj xOB7CwVoazbBuzesqSm9U9jZURsyY9CBOCufbhD7zMbqVvYcmclq3GRAn1vuiIFTfE 224+Eqi9B0NY9boy45gWH6lawNf2gj5Q+YSzfH4g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407767AbgDPGIx (ORCPT ); Thu, 16 Apr 2020 02:08:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:37546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407698AbgDPGIn (ORCPT ); Thu, 16 Apr 2020 02:08:43 -0400 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 536E220771; Thu, 16 Apr 2020 06:08:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587017322; bh=UbzFaYMrN1j2xemeLV2+pIN8pGIBq/3wkSPSZQ0MtR8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=THaBoiDIZWZeYbTFzn3XI1UxvWKDapxdVa9hfmjcMgp6yvJyB8Vpqhj1C1/xUF0dq c3ZGuaazxq2/KXG6A0IuYqjcqcBwrFANsoAmbz8WG0BkSMPueN5BFs0ub3dgvEH3Ls UpmjWot9ZNZ4GzHl5LkioCVC6whAAcgaue5jLDPM= Date: Thu, 16 Apr 2020 15:08:35 +0900 From: Masami Hiramatsu 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 , Michal Hocko , David Rientjes , Matthew Wilcox , "Eric W . Biederman" , "Guilherme G . Piccoli" , Alexey Dobriyan , Thomas Gleixner , Greg Kroah-Hartman , Christian Brauner Subject: Re: [PATCH v2 0/3] support setting sysctl parameters from kernel command line Message-Id: <20200416150835.13c0b13e406c694d63bdcd47@kernel.org> In-Reply-To: <3fc1303a-cb57-b96e-ce77-7ff6407ab538@suse.cz> References: <20200414113222.16959-1-vbabka@suse.cz> <20200415122359.939364e2c54c389c6b3f6457@kernel.org> <3fc1303a-cb57-b96e-ce77-7ff6407ab538@suse.cz> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 15 Apr 2020 10:56:35 +0200 Vlastimil Babka wrote: > On 4/15/20 5:23 AM, Masami Hiramatsu wrote: > > Hi Vlastimil, > > > > On Tue, 14 Apr 2020 13:32:19 +0200 > > Vlastimil Babka wrote: > > > >> 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 > > > > Sounds good. And would you consider to use the bootconfig instead of (or > > in addition to) the kernel command line, because it is too short to describe > > the sysctl options? > > "Instead of" - no, as that would defeat the scenario of "I just want to set this > one sysctl in grub (possibly interactively) and not update initrd for that". If > constructing bootconfig is of similar effort of loading sysctl.conf from initrd, > then I see little benefit? > > "in addition to" - sure! but I hoped that's what already happens as it seemed to > me that options from bootconfig are appended to the command line that's then > parsed by everyone else, no? But I'll try it to be sure. Yes, all configurations under "kernel" key are passed to kernel command line, so you don't need to change anything :) > > With the bootconfig, you can describe the sysctl parameters in an > > independent file as same as /etc/sysctl.conf. It is easy to convert > > form sysctl.conf to bootconfig because bootconfig format is simply > > enhanced structured sysctl.conf :). What we just need is; > > > > (echo "sysctl {"; cat "/etc/sysctl.conf"; echo "}") >> sysctl.bconf > > bootconfig -a sysctl.bconf /boot/initrd.img > > > > Even with only your patch, since bootconfig can pass the options which > > start with "kernel." prefix to kernel command line, so; > > > > (echo "kernel.sysctl {"; cat "/etc/sysctl.conf"; echo "}") >> sysctl.bconf > > bootconfig -a sysctl.bconf /boot/initrd.img > > Hmm I hope I figure out if the way virtme creates initrd on the fly supports > hooking a bootconfig addition :) Would you mean how to hook the mkinitrd to add /etc/bootconfig? Thank you, > -- Masami Hiramatsu