Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3464150pxk; Mon, 5 Oct 2020 10:16:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPHancc9ahYCS+56EYErSq3e1p0vFMdIq56twXWGynoiAPI1X3latV3usrhin6GJMJHNP1 X-Received: by 2002:aa7:d7d2:: with SMTP id e18mr744022eds.120.1601918182710; Mon, 05 Oct 2020 10:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601918182; cv=none; d=google.com; s=arc-20160816; b=xUKus95NWHdNhOjte/3IB3vvlxElfT9GCX8zY7OIHwm9r6kYMSPvj0SWTXLZU7h3Uj IPziH6I04jVV5JMbGwMyf60tjN7ciFlKXjxVtssYO0qaUBewacSC0zbJ4NdWMdyzbdYZ S6V66yjOfuWHTATuDskwQGvFlHPMQQm54iCI/7TysKY7KP77lRxcvA2udMkGtOwj/NXX aoXmhPBWfvruq+mzOSKMpAqB6rBbZxEbsveqy+L6IsUQuM3sVm5z+B8zN8mYbuNz3IXF 5duvE3OqyTy06aGc+63eibyzu+sP/jrKjGMM8aHYKjvee4ImJJSUj91JeRCFJ22UZlCH s7QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BcgNAhc+it3gLhMdpztpsecEyaKryswiwDEDxzND7sI=; b=FhTnwFk+MXQLEwTaFVDVqNtA5EuDi3YDZ4LBuwS+izayZlwkKedQB4kXnuolQ+rVSX xuj+Aak/siPPLDHPmRLJWckI0X9aTJtsroZVVrCr6RDXomtxYUwu1tB5hP8QpBMqWHgS JOLlCjAqzVl4e2JKkiD5wvcewp2RhvJQnUu2gCwZQ8qEAomjbvfEB2iMnK9AvfKd9nfs 1QoGhY1krN6MNyk5vPREwWFuz9iR0yek4cySwIe8I9WufcT5iaTrRqf5szkoKz2HHmVF 44mWml8tBaEvPFm5vXWNo9wPfCnLM66BsXkbwu2rMn3mok9EK58mD2f9tfnqm306xLvk kwhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si165998ejw.321.2020.10.05.10.15.59; Mon, 05 Oct 2020 10:16:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727070AbgJERM6 (ORCPT + 99 others); Mon, 5 Oct 2020 13:12:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:41002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbgJERM6 (ORCPT ); Mon, 5 Oct 2020 13:12:58 -0400 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 Cc: will@kernel.org, james.morse@arm.com, tglx@linutronix.de, mingo@redhat.com, dyoung@redhat.com, bhe@redhat.com, corbet@lwn.net, John.P.donnelly@oracle.com, prabhakar.pkin@gmail.com, bhsharma@redhat.com, horms@verge.net.au, robh+dt@kernel.org, arnd@arndb.de, nsaenzjulienne@suse.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-doc@vger.kernel.org, guohanjun@huawei.com, xiexiuqi@huawei.com, huawei.libin@huawei.com, wangkefeng.wang@huawei.com 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200907134745.25732-8-chenzhou10@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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