Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2230687iof; Tue, 7 Jun 2022 23:56:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVYTNQIlA6WsfgY67Krc+CBPwHFS0uFDbprKpEq1EbahZH+Avvd8ONMsRFf+e+/QJIylYG X-Received: by 2002:a05:6a00:2344:b0:51c:157f:83d5 with SMTP id j4-20020a056a00234400b0051c157f83d5mr15294669pfj.5.1654671390643; Tue, 07 Jun 2022 23:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654671390; cv=none; d=google.com; s=arc-20160816; b=t0pHIDL1JUKJkmyGD0hu3AxVfQotY6NF9RCncPanR4negxmlQcIWjRMw6FHRrgHj4C b8iKjJQRnceb9NMXDLw/8StN/SunLSXd7d3c48yOoggoyVxEMdyhCHN0bPV68v+Bsqhr Dk9CSaRxiOFt9EcVaIMsVSV03nf+XOuYDseFzj0dnt/MmTaK393L5PTSaboG54sj6SJ1 e7nWWcI/9OVhFyTH8OYJNdfHDq31MJei8kmeGG01en/pqMvFiI0brDlODuLzVVUsVeS8 c4AmcMORYnU9p9dDDk0nmwKRhGQiB1i6bpun3T4u5qsj5xccJ9pvFk8gfENuvII0dUIz uo3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V5n7RskVKP1lkUAH2EjF8RedQEXHRrdfvn+kcEQHl4g=; b=EOyqLxHQrUPli30pxoT+4ds/WC6hM3ggSSS12N7isITuXfNxq082dnXjL59jp+rmv1 EQZRLqMTBljXo3vPopRDS6hyOOeH0RUfUKkoMf0kvIpoEmni6dSWBlwemamH6m6Xh/Q4 Bix+ZNh3hI5UtCci7X43cCWHsJA4p4AVFc/GA+nc/xjbxXcooYSUyv1vPtLZjLYIriRX 5ZPFN3HOpPPH8YLhNYMzMzlbn/A7UGoI3G2i/tL4Z0Uzlv5uEox6CqkHaCFz01FhLj9y 9oS/v0IWKe4yde1KDweIjrN5b7llONcCbK+Ga1ee5DxMWxIxTsTEBw9GC/pWWD2yMw+e lVwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bH0HwbH4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p17-20020a170903249100b0015ea266647fsi5613670plw.394.2022.06.07.23.56.16; Tue, 07 Jun 2022 23:56:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bH0HwbH4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242933AbiFHDGz (ORCPT + 99 others); Tue, 7 Jun 2022 23:06:55 -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 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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