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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2BCFC433EF for ; Wed, 8 Jun 2022 03:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241653AbiFHDG6 (ORCPT ); Tue, 7 Jun 2022 23:06:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382747AbiFHDFv (ORCPT ); Tue, 7 Jun 2022 23:05:51 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C42451CC5F2 for ; Tue, 7 Jun 2022 17:32:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654648320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=V5n7RskVKP1lkUAH2EjF8RedQEXHRrdfvn+kcEQHl4g=; b=bH0HwbH4zmygSQIN3X6n7gVHrhwjHjVlBNNKlzdRb7x/K6siI632129wczX1S1v6zBfuxq 3i3XAaC3haBTcDnz4ahBs/4W45HZog9KySgVK6Vo7qpswKwO9gPeWaF4NQ0c6KycvHmgnG pLM0VSNmlFTTmEk8GH0e9/mwClrEiGg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-171-vA2S3ik2NfO8vrB9KFwFzA-1; Tue, 07 Jun 2022 20:28:40 -0400 X-MC-Unique: vA2S3ik2NfO8vrB9KFwFzA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BDFF580159B; Wed, 8 Jun 2022 00:28:39 +0000 (UTC) Received: from localhost (ovpn-12-81.pek2.redhat.com [10.72.12.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87C1840466A3; Wed, 8 Jun 2022 00:28:38 +0000 (UTC) Date: Wed, 8 Jun 2022 08:28:31 +0800 From: Baoquan He To: Pasha Tatashin Cc: Sasha Levin , "Eric W. Biederman" , rburanyi@google.com, Greg Thelen , viro@zeniv.linux.org.uk, kexec mailing list , linux-fsdevel@vger.kernel.org, LKML Subject: Re: [PATCH v2 2/2] kexec_file: Increase maximum file size to 4G Message-ID: References: <20220527025535.3953665-1-pasha.tatashin@soleen.com> <20220527025535.3953665-3-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/07/22 at 12:02pm, Pasha Tatashin wrote: > On Sun, Jun 5, 2022 at 10:56 PM Baoquan He wrote: > > > > On 05/27/22 at 02:55am, Pasha Tatashin wrote: > > > In some case initrd can be large. For example, it could be a netboot > > > image loaded by u-root, that is kexec'ing into it. > > > > > > The maximum size of initrd is arbitrary set to 2G. Also, the limit is > > > not very obvious because it is hidden behind a generic INT_MAX macro. > > > > > > Theoretically, we could make it LONG_MAX, but it is safer to keep it > > > sane, and just increase it to 4G. > > > > Do we need to care about 32bit system where initramfs could be larger > > than 2G? On 32bit system, SSIZE_MAX is still 2G, right? > > Yes, on 32-bit SSIZE_MAX is still 2G, so we are safe to keep 32-bit > systems run exactly as today. > > #define KEXEC_FILE_SIZE_MAX min_t(s64, 4LL << 30, SSIZE_MAX) > Is meant to protect against running over the 2G limit on 32-bit systems. OK. In fact I was wrong. I386 doesn't have kexec_file loading support. > > > > > Another concern is if 2G is enough. If we can foresee it might need be ~~ 4G, typo > > enlarged again in a near future, LONG_MAX certainly is not a good > > value, but a little bigger multiple of 2G can be better? > > This little series enables increasing the max value above 2G, but > still keeps it within a sane size i.e. 4G, If 4G seems too small, I > can change it to 8G or 16G instead of 4G. Just raising to try to discuss if 4G is enough. I have no knowledge about how much is enough, and we don't need to guess, if you think 4G is enough according to information you get, that's OK. We can wait a while to see if other people have words about the vlaue. If no, then 4G is a good one. Thanks Baoquan