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=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 AEFB0C2BB84 for ; Mon, 7 Sep 2020 17:22:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 773062080A for ; Mon, 7 Sep 2020 17:22:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729667AbgIGRVf (ORCPT ); Mon, 7 Sep 2020 13:21:35 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53026 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729668AbgIGNri (ORCPT ); Mon, 7 Sep 2020 09:47:38 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id C048235DF6F689BCD2FB; Mon, 7 Sep 2020 21:46:53 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020 21:46:46 +0800 From: Chen Zhou To: , , , , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH v12 1/9] x86: kdump: move CRASH_ALIGN to 2M Date: Mon, 7 Sep 2020 21:47:37 +0800 Message-ID: <20200907134745.25732-2-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200907134745.25732-1-chenzhou10@huawei.com> References: <20200907134745.25732-1-chenzhou10@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org CONFIG_PHYSICAL_ALIGN can be selected from 2M to 16M and default value is 2M, so move CRASH_ALIGN to 2M, with smaller value reservation can have more chance to succeed. And replace the hard-coded alignment with macro CRASH_ALIGN in function reserve_crashkernel(). Suggested-by: Dave Young Signed-off-by: Chen Zhou --- arch/x86/include/asm/kexec.h | 3 +++ arch/x86/kernel/setup.c | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/include/asm/kexec.h b/arch/x86/include/asm/kexec.h index 6802c59e8252..83f200dd54a1 100644 --- a/arch/x86/include/asm/kexec.h +++ b/arch/x86/include/asm/kexec.h @@ -18,6 +18,9 @@ # define KEXEC_CONTROL_CODE_MAX_SIZE 2048 +/* 2M alignment for crash kernel regions */ +#define CRASH_ALIGN SZ_2M + #ifndef __ASSEMBLY__ #include diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 3511736fbc74..296294ad0dd8 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -402,9 +402,6 @@ static void __init memblock_x86_reserve_range_setup_data(void) #ifdef CONFIG_KEXEC_CORE -/* 16M alignment for crash kernel regions */ -#define CRASH_ALIGN SZ_16M - /* * Keep the crash kernel below this limit. * @@ -530,7 +527,7 @@ static void __init reserve_crashkernel(void) start = memblock_find_in_range(crash_base, crash_base + crash_size, - crash_size, 1 << 20); + crash_size, CRASH_ALIGN); if (start != crash_base) { pr_info("crashkernel reservation failed - memory is in use.\n"); return; -- 2.20.1