Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1828166rwb; Mon, 7 Nov 2022 06:18:54 -0800 (PST) X-Google-Smtp-Source: AMsMyM4mOOCSv18f4QVU02aBji/+5fZ87+4NGtP3BTr2UL8DnW6ntL/2PD9DLB5N90eSew95gxMP X-Received: by 2002:a05:6402:2751:b0:443:d90a:43d4 with SMTP id z17-20020a056402275100b00443d90a43d4mr51558447edd.368.1667830734202; Mon, 07 Nov 2022 06:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830734; cv=none; d=google.com; s=arc-20160816; b=YQsRx9r4k0z9aiqsWOTkedtvujRylm7B2udK9EKru/djqdVFQf6H+foAAb9F5WEvX4 /9CVCfq7y8F98ljn3OU7KtLZXcaWcLZERZQ8hyaLLD1XP/Lx+L2l7etorcXDB8KPVLiS p/SNkKfkBbgpG2JPTeV1HPP0msB4fA45q963O27SvBr7uA+74SKxOl2/TxG/SI0a14W2 342SvQmQQBIo/Z0CKo5M9njWpx19jwb6FclIffMksmHl4tNowqRQDIiit9OQRghRFpMd gqwK8gbWVLPi7suOt4fDQ/LQjJezEgv1tMcu/u5z4mbR0BIv4x4sYOyHpNvDPlVEGDZf UUDQ== 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; bh=qJywSUq4cT1HbvCvVWjmnqGQ4+JW0h14D7OJOaqevts=; b=x6pZYdmDUvBbyJFwjg5d9i8sQv7ynkNHVQa191faPhx83BQ2/S7iJmKw2MoAC69HdT /NINxfVOP17BYS9bsAadzINP63mMQo9ERChOAKsEPOIfVze7xjfy5wgogufKu/tNL01Y nF9puApx750rvosOnh8A0gDL28lz9feM0CszgvQQYsZ5YJEjiI84vTNLDbjEwTRRk39G TPhaApRNFln+jN4UEvvGOqvJx4UvaWsvNQC7zLJpC/3blwyzBOuXSVX6Kv38s+dT9NnO 767s73BJJjzXWFC5CDZdcbOURHsoEoFEim7nUeu1OuGEdoGHXCZ7XsDJWsA83GfMmBF3 GjgQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he41-20020a1709073da900b007ad902cd1b2si10367681ejc.921.2022.11.07.06.18.29; Mon, 07 Nov 2022 06:18:54 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231590AbiKGOHU (ORCPT + 93 others); Mon, 7 Nov 2022 09:07:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231875AbiKGOHS (ORCPT ); Mon, 7 Nov 2022 09:07:18 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D61F1A055; Mon, 7 Nov 2022 06:07:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5C5CCB811E4; Mon, 7 Nov 2022 14:07:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 288D9C433D6; Mon, 7 Nov 2022 14:07:11 +0000 (UTC) Date: Mon, 7 Nov 2022 14:07:07 +0000 From: Catalin Marinas To: Zhen Lei Cc: Dave Young , Baoquan He , Vivek Goyal , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Jonathan Corbet , linux-doc@vger.kernel.org, "Eric W . Biederman" , Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , John Donnelly , Dave Kleikamp Subject: Re: [PATCH v3 1/2] arm64: kdump: Provide default size when crashkernel=Y,low is not specified Message-ID: References: <20220711090319.1604-1-thunder.leizhen@huawei.com> <20220711090319.1604-2-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220711090319.1604-2-thunder.leizhen@huawei.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Mon, Jul 11, 2022 at 05:03:18PM +0800, Zhen Lei wrote: > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 339ee84e5a61a0b..5390f361208ccf7 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -96,6 +96,14 @@ phys_addr_t __ro_after_init arm64_dma_phys_limit = PHYS_MASK + 1; > #define CRASH_ADDR_LOW_MAX arm64_dma_phys_limit > #define CRASH_ADDR_HIGH_MAX (PHYS_MASK + 1) > > +/* > + * This is an empirical value in x86_64 and taken here directly. Please > + * refer to the code comment in reserve_crashkernel_low() of x86_64 for more > + * details. > + */ > +#define DEFAULT_CRASH_KERNEL_LOW_SIZE \ > + max(swiotlb_size_or_default() + (8UL << 20), 256UL << 20) I agree with Will here, we need a better comment and we might as well change the default value to something else until someone tells us that the default is not large enough. The default swiotlb size is 64M, so we need to cover that. The extra 8MB for any additional low allocations are ok as well but the 256MB doesn't make much sense to me, or at least not together with the rest. If the main kernel got a command line option for a larger swiotlb, does the crash kernel boot with the same command line? If not, we can just go for a fixed 128M value here, which is double the default swiotlb buffer. -- Catalin