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,NICE_REPLY_A,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 A3DC9C4363A for ; Tue, 6 Oct 2020 01:35:53 +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 1E4732076B for ; Tue, 6 Oct 2020 01:35:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LGtHuWSw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E4732076B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.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:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CEMAf4KARiwFlGpZbBnsiUctHH5KgRsQybZ37H2oncQ=; b=LGtHuWSwdtqOXPs4kOE6lU/KM Noms4M/1OHG0ZhFKMGa7XhlKHzY7CBNK1x8xDoMjs6whbE7ByF9AkIgifASwyDmWVyPBOmCJq3snX nQqaqe39Rw4Z1bCLw3TTV4tesdRXH1XturVC9naNuxcJOyxIlMNO5ybondSmktq/8JJwi0Irf8UKt wNULin12knyv8niHfc9KKEfPZwWdeCpfOhvPHNg3ul2k37SM9eT8T1xzXYSN5KHTNTWKcl/NWWkUU c1nm+IzfdpcAlVRIgqWS4FcIiKewSgQOu6KZid9KiwhtvrKhetTY4visqmcb1YcgR9Kvqko3rFVv4 OxW4cKxwQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPbsA-0004yK-CB; Tue, 06 Oct 2020 01:34:34 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPbs6-0004xD-VL; Tue, 06 Oct 2020 01:34:31 +0000 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 37E85699AB092B3F594E; Tue, 6 Oct 2020 09:34:23 +0800 (CST) Received: from [10.174.176.61] (10.174.176.61) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 6 Oct 2020 09:34:15 +0800 Subject: Re: [PATCH v12 7/9] kdump: add threshold for the required memory To: Catalin Marinas References: <20200907134745.25732-1-chenzhou10@huawei.com> <20200907134745.25732-8-chenzhou10@huawei.com> <20201005171248.GB14576@gaia> From: chenzhou Message-ID: <8777c5be-a8d1-50bd-a44d-168dea009e13@huawei.com> Date: Tue, 6 Oct 2020 09:34:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20201005171248.GB14576@gaia> X-Originating-IP: [10.174.176.61] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201005_213431_290648_0083058C X-CRM114-Status: GOOD ( 15.46 ) 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 2020/10/6 1:12, Catalin Marinas wrote: > 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. Ok, i will drop this patch in next version. Thanks, Chen Zhou > > 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. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel