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=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 5EB56C2BA2B for ; Thu, 16 Apr 2020 06:39:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B35C206D6 for ; Thu, 16 Apr 2020 06:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587019150; bh=YnynxQuvsCOyaldFFl9hLVsbWby+cA0IYVHULhsC/7Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=KdLKoz3gvYkr7NQk3U0J542UlEZtaVmD/VW/WUCtpN66pDVJ0bsW7gsZ5cFXNvpcd smnXnedLg7ZISa6JhPeKlB6WKklvaDi1dCiol+n2ptmOh3gqLEcJL4IYH49+ekp64i NhmZBW1RslAlQqhWjvLdOEWr9TY0CKeeg7Sm3a2M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408401AbgDPGjB (ORCPT ); Thu, 16 Apr 2020 02:39:01 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:52478 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2408187AbgDPGii (ORCPT ); Thu, 16 Apr 2020 02:38:38 -0400 Received: by mail-pj1-f68.google.com with SMTP id ng8so942500pjb.2; Wed, 15 Apr 2020 23:38:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JhqXMpaDtR4QdQFxjiccypTqasAwt8uY42ZQFRo6zec=; b=H6AK+DKim638KwerflDntjT2jf1x14TBm9C6zOsdPFoqEih3990vcisd6/TnAhakUJ 0LWzjKOb6WAqJKMOWcIOOxfwicAsecwKJNrYvxA9zkz/YMHEUiCa4O9ygR0EeUwJLccW jG0uvsTTDe3PWtCLgf/DV4yrAO2Y+5+VG4a0AV84q8G3ioM1kA8TB66xzLkSLgZ/cird n59XRfLQaO3g07iZksPZ4LZQm8jztm45emIccOp5OZmdKVLYnh1+LZikQNVuf3nGMOLB zQ6xW1Fb0ibItMvgwWD0eyW4FUOqmSvYEqLKzNB4z//cpsuWFRR9eH++Uo+X/Khx6O/b 7Dgw== X-Gm-Message-State: AGi0PuYhJUWV+f05SICbS6ZbnU+WyaB5hs615tngb0z/aHFvdOp2vxil m8huFyhRph8LtrJU6yoRw+mbMse/uhE= X-Google-Smtp-Source: APiQypLiX3EEejSxMY4gob9qPf7SrIgOr5sEycuMHTgXEAp2MDuLtUM6+B/3dTfOGpjnAYR05+tkBA== X-Received: by 2002:a17:902:107:: with SMTP id 7mr8248874plb.302.1587019116498; Wed, 15 Apr 2020 23:38:36 -0700 (PDT) Received: from 42.do-not-panic.com (42.do-not-panic.com. [157.230.128.187]) by smtp.gmail.com with ESMTPSA id p8sm1549014pjd.10.2020.04.15.23.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2020 23:38:35 -0700 (PDT) Received: by 42.do-not-panic.com (Postfix, from userid 1000) id 7570B40277; Thu, 16 Apr 2020 06:38:34 +0000 (UTC) Date: Thu, 16 Apr 2020 06:38:34 +0000 From: Luis Chamberlain To: Masami Hiramatsu Cc: Vlastimil Babka , Andrew Morton , 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: <20200416063834.GO11244@42.do-not-panic.com> References: <20200414113222.16959-1-vbabka@suse.cz> <20200415122359.939364e2c54c389c6b3f6457@kernel.org> <20200415063041.GT11244@42.do-not-panic.com> <20200416150206.d3e103a1a5497b3518d4359c@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200416150206.d3e103a1a5497b3518d4359c@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 16, 2020 at 03:02:06PM +0900, Masami Hiramatsu wrote: > Hi Luis, > > On Wed, 15 Apr 2020 06:30:41 +0000 > Luis Chamberlain wrote: > > Currently the maximum config size size is 32KB and the total key-words > > (not key-value entries) must be under 1024 nodes. Note: this is not > > the number of entries but nodes, an entry must consume more than 2 nodes > > (a key-word and a value). So theoretically, it will be up to 512 > > key-value pairs. If keys contains 3 words in average, it can contain 256 > > key-value pairs. In most cases, the number of config items will be under > > 100 entries and smaller than 8KB, so it would be enough. If the node > > number exceeds 1024, parser returns an error even if the file size > > is smaller than 32KB. Anyway, since bootconfig command verifies it when > > appending a boot config to initrd image, user can notice it before > > boot. > > ``` > > *recommending* bootconfig due to the limitation of cmdline seems > > sensible, however if we advise that.. wouldn't the space for 512 > > theoretical entries full up rather fast? > > Yeah, I think it is easier to hit the node number limitation rather > than fill up the space. However, since the bootconfig supports comments, > if user writes enough readable config file, I think it's probably the > right balance :) > If you think the 512 entries is too small, it is easy to expand it > upto 32K (64K nodes). But it may consume 512KB memory only for the > node (meta) data. Current 1024 nodes consumes 8KB (8bytes/node), so > compared with the max data size (32KB), I think it is a better balance. Yeah, and well at least x86 / x86_64 sets COMMAND_LINE_SIZE to 2048 right now (2 KB), that'd hit the limit of abuse of cmdline pretty fast too. I see no way to scale this reasonably if people abuse syctls on the command line but to use bootconfig and bite the bullet on size, to keep sanity. Luis