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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8DBE4C433F5 for ; Tue, 26 Apr 2022 18:03:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=nsaXmxSR0bYN7Wa5Tx18/I2Fe217cBgcQivl48FA/hU=; b=vucbXz5+WODP4z Ltm1d3tZr8DtqFBEV4zaEUbdIEf7BHh0qeyyDMF0xJtu5oSGi7SyqF6ubSD85V66nw2sU7457ZRGN qxCcSQCQ9v+p7hlZudtMOl/SdSftJLYiZ0TlGJLDjcMPm6gL9orR09ycx6ILsvtE0TgFhtSDPQcT2 v0tCgsnb+6gFgJXm0JdB+2KSfvsg37P3Ppg8Ri1jNmWM8mKdFqiVzXdtPMAJDQ/dkt/mTUbXyH1BP T2N9Zuy3n4ErJYX0NVV5J3ms7w0Rm9EOw0WRuVSbZsy4SqrUazC58sHPGxNuckBL03r1LUN4WuSXp NLLrLl/+/TQsRUdcT6PA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njPWf-00Fao6-Ou; Tue, 26 Apr 2022 18:03:01 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1njPWZ-00Faks-MK; Tue, 26 Apr 2022 18:02:57 +0000 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 dfw.source.kernel.org (Postfix) with ESMTPS id 91E3961779; Tue, 26 Apr 2022 18:02:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9B48C385A4; Tue, 26 Apr 2022 18:02:49 +0000 (UTC) Date: Tue, 26 Apr 2022 19:02:46 +0100 From: Catalin Marinas To: Zhen Lei Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , linux-kernel@vger.kernel.org, Dave Young , Baoquan He , Vivek Goyal , Eric Biederman , kexec@lists.infradead.org, Will Deacon , linux-arm-kernel@lists.infradead.org, Rob Herring , Frank Rowand , devicetree@vger.kernel.org, Jonathan Corbet , linux-doc@vger.kernel.org, Randy Dunlap , Feng Zhou , Kefeng Wang , Chen Zhou , John Donnelly , Dave Kleikamp Subject: Re: [PATCH v22 5/9] arm64: kdump: Reimplement crashkernel=X Message-ID: References: <20220414115720.1887-1-thunder.leizhen@huawei.com> <20220414115720.1887-6-thunder.leizhen@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220414115720.1887-6-thunder.leizhen@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220426_110255_859277_4B51474F X-CRM114-Status: GOOD ( 22.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Apr 14, 2022 at 07:57:16PM +0800, Zhen Lei wrote: > /* > * reserve_crashkernel() - reserves memory for crash kernel > * > * This function reserves memory area given in "crashkernel=" kernel command > * line parameter. The memory reserved is used by dump capture kernel when > * primary kernel is crashing. > + * > + * NOTE: Reservation of crashkernel,low is special since its existence > + * is not independent, need rely on the existence of crashkernel,high. > + * Here, four cases of crashkernel low memory reservation are summarized: > + * 1) crashkernel=Y,low is specified explicitly, the size of crashkernel low > + * memory takes Y; > + * 2) crashkernel=,low is not given, while crashkernel=,high is specified, > + * take the default crashkernel low memory size; > + * 3) crashkernel=X is specified, while fallback to get a memory region > + * in high memory, take the default crashkernel low memory size; > + * 4) crashkernel='invalid value',low is specified, failed the whole > + * crashkernel reservation and bail out. Following the x86 behaviour made sense when we were tried to get that code generic. Now that we moved the logic under arch/arm64, we can diverge a bit. I lost track of the original (v1/v2) proposal but I wonder whether we still need the fallback to high for crashkernel=Y. Maybe simpler, no fallbacks: crashkernel=Y - keep the current behaviour, ignore high,low crashkernel=Y,high - allocate above ZONE_DMA crashkernel=Y,low - allocate within ZONE_DMA >From your proposal, the difference is that the Y,high option won't have any default ZONE_DMA fallback, one would have to explicitly pass the Y,low option if needed. Just a thought, maybe it makes the code simpler. But I'm open to discussion if there are good arguments for the proposed (x86-like) behaviour. One argument could be for crashkernel=Y to fall back to high if distros don't want to bother with high/low settings. Another thing I may have asked in the past, what happens if we run a new kernel with these patches with old kexec user tools. I suspect the crashkernel=Y with the fallback to high will confuse the tools. BTW, please separate the NO_BLOCK_MAPPINGS optimisations from the crashkernel above 4G. Let's get the crashkernel reservations sorted first, it's been around for too long. Thanks. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel