Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp966938ybz; Wed, 15 Apr 2020 23:40:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKyO7YaK9Bo0FToDo9VCGN4Kd0zeTCpjFclpLvfThpDUUMMRUJE5VmoyPffs/abusy60pH0 X-Received: by 2002:a05:6402:48b:: with SMTP id k11mr7558812edv.47.1587019236640; Wed, 15 Apr 2020 23:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587019236; cv=none; d=google.com; s=arc-20160816; b=afH1VCo8roxUHRnyjzil4eXwz5HiyhuRI3oQ9u5mg8PJKcZlM4Sgl6cVpUgaG5G5OR /WZpG8pmkkU88zqnukmRf1adqlXJWjl+ksZil2PPyCfn8fLw+zZMm26HGdp1Ip7DP1rU TSHdKL6MGBIG7b42OlcV5YheA1/PeQPYGF8c2FEv3hYpjKw3//J283tnkurDgQpsHS9K lGQTbvOj7AEQY7dYnczHye+TOJwoszl03GIFyf0ASSB8KCu1exNTejm/oskB7do7dUAp xFEjvcEZmpEMQZsYdDMUKLRKPoteTO1i2N1jlMwT9ekht0t5TIFax3MIshQcxRBtWRvd BYYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JhqXMpaDtR4QdQFxjiccypTqasAwt8uY42ZQFRo6zec=; b=k7Fu6VsJmVuEqxVWFEIU23vTYulkAntVW19GeOtaULYlDSnTev0Zq4gF9XwcaiZXHC JawwXRwVQXrTr4LdxfmTv+eyGKGWIvKlAUifiwcWcDdlvXr/0akwLk8WVaHAirzX+txi +tkeM/gtlS3ty04cgQdQBwSqqY2lLb62Ri9Q6meOY7tCv88Tg3q7RExpp0Cg14iuEAI9 fO0YRCc75mxIEccRYY6yyEW/qjJz9LvxOz61UQyXOER5hhjK+y2NEJgR+SfrrvcHPEQh QgVOeCz9+TqavGxK9kgHtsQ4ZKUx1JnQrrueWro8+uyBcsooe7FKLHYv+2dkK1qTV6Lq hr8A== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a31si4851526ede.290.2020.04.15.23.40.13; Wed, 15 Apr 2020 23:40:36 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408379AbgDPGiz (ORCPT + 99 others); Thu, 16 Apr 2020 02:38:55 -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-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