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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A16FC4363A for ; Mon, 5 Oct 2020 17:14:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2479820853 for ; Mon, 5 Oct 2020 17:14:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="s8XtJEbm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2479820853 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=Nk4WOGCIGMRIJ1IlWta5Lq/QdM0vHd+c44jnTRmMwys=; b=s8XtJEbmr9V+Ucvpa4j0RSGow m8qrSd1prbX8exVt/T3pa0tbiLDBmxznCw1wHkf3Q0HiFSLO29pwKOH1WbmveT5c6vQjHMiTzLbhP TNWpKPGVVImfnYMiRMvUxF+lqJmCDrUBilkC2d7vusZAPin6tj1NNXJ/5UTJ2NU98IM1fDSLHzVGB h977EDJGhu7vUsiaV0OJxPAu6Dp3MuCmpA0IhYzOLkW1xpemCO1xFtU4pLhSIx4RiQX5EGKtM2W2y 1p+XcgdMvHpFjNB4IHHraSONkjbuo3AtZA5VKOQckQzuH7QoqlOxEuaPQDgX8DUw4rUcixrQQt2L2 Qn3u2xPKg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPU2o-0004Fj-1t; Mon, 05 Oct 2020 17:13:02 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPU2k-0004Ej-Lg; Mon, 05 Oct 2020 17:12:59 +0000 Received: from gaia (unknown [95.149.105.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A099B207EA; Mon, 5 Oct 2020 17:12:52 +0000 (UTC) Date: Mon, 5 Oct 2020 18:12:49 +0100 From: Catalin Marinas To: Chen Zhou Subject: Re: [PATCH v12 7/9] kdump: add threshold for the required memory Message-ID: <20201005171248.GB14576@gaia> References: <20200907134745.25732-1-chenzhou10@huawei.com> <20200907134745.25732-8-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200907134745.25732-8-chenzhou10@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201005_131258_793271_D1698613 X-CRM114-Status: GOOD ( 18.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wangkefeng.wang@huawei.com, linux-doc@vger.kernel.org, bhsharma@redhat.com, huawei.libin@huawei.com, guohanjun@huawei.com, will@kernel.org, bhe@redhat.com, corbet@lwn.net, mingo@redhat.com, dyoung@redhat.com, John.P.donnelly@oracle.com, arnd@arndb.de, xiexiuqi@huawei.com, horms@verge.net.au, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, james.morse@arm.com, prabhakar.pkin@gmail.com, nsaenzjulienne@suse.de 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 Mon, Sep 07, 2020 at 09:47:43PM +0800, Chen Zhou wrote: > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 3f735cb37ace..d11d597a470d 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -378,6 +378,15 @@ int __init reserve_crashkernel_low(void) > } > > #if defined(CONFIG_X86) || defined(CONFIG_ARM64) > + > +/* > + * Add a threshold for required memory size of crashkernel. If required memory > + * size is greater than threshold, just go for high allocation directly. The > + * value of threshold is set as half of the total low memory. > + */ > +#define REQUIRED_MEMORY_THRESHOLD (memblock_mem_size(CRASH_ADDR_LOW_MAX >> \ > + PAGE_SHIFT) >> 1) > + > #ifdef CONFIG_KEXEC_CORE > /* > * reserve_crashkernel() - reserves memory for crash kernel > @@ -422,7 +431,7 @@ void __init reserve_crashkernel(void) > * So try low memory first and fall back to high memory > * unless "crashkernel=size[KMG],high" is specified. > */ > - if (!high) > + if (!high && crash_size <= REQUIRED_MEMORY_THRESHOLD) > crash_base = memblock_find_in_range(CRASH_ALIGN, > CRASH_ADDR_LOW_MAX, > crash_size, CRASH_ALIGN); Since any change now is affecting the x86 semantics slightly, I'd suggest you drop this patch. We can add it later if needed, once the core changes are in. Thinking about this, if one requires a crashkernel reservation that allocates all of the ZONE_DMA, it would probably be noticed and explicit ,high/,low options can be used. Note that we are also trying to make ZONE_DMA full 32-bit on non-RPi4 hardware. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel