Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1954572rwl; Fri, 24 Mar 2023 19:13:22 -0700 (PDT) X-Google-Smtp-Source: AKy350a8ICuYA/b4A0kIgR5RnQ6NytAh254joO7lH9/MEDkjHQ5b4wHXQwuWEZKVcEMHn0rLa3wq X-Received: by 2002:a17:907:a485:b0:8b2:abcd:624 with SMTP id vp5-20020a170907a48500b008b2abcd0624mr5977478ejc.0.1679710402249; Fri, 24 Mar 2023 19:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679710402; cv=none; d=google.com; s=arc-20160816; b=HfHCfw54j76ZYAH735Kbx3szUUAv0d92rGXhfPYJkVz1hB2G983R04fMHL9+F7fYqm 008TiBK+pmGllSz9sVM/TkNieBRxBKqmyZusU4FHX+ohMRxj7Y9NPcsnbAKuhbsR8+sE IeEYalR67oqX46HrCSYrXkZ+HZw19v2iHOD8FAIlSW+0wM4yCpBQrwbrBNYTY1fXRUSo Mn4vMDd9BlfVNQLvgyjI200511VZmTXz7oGlb/f81xotJhmXPgxpd5hWykgFdaRUGXAg uetJQsehY9n9s+Xc7jgKtCWvhKFrr5OWimnB1uTVGbO6I3DUkjOK5DJx++E/IQeCE2pN kUIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=m+1BP/IWhWCk80QiLtQ+oiT0cuu1K2dtbD3kWSLOyvI=; b=Y7s68U74Jmi4Frw/U1q6ITvdnySe+q42Z65/vSAs8uq99z/uF5+4FLCzW2ZDMkCmRJ LnpKPtU+Zho456PUSNx/K1YkZavMoi6ZBuDOEimSDGCfmWke1Rl6MrVYF680gK4c2frL c3MFOnkorS8m9xzpqD8KEy8I1fb5vSiAeJyqnbMMHNaVbMOPQ2EUF6yVh2ypPwHeUhNr VkJh+K5c3cR65qidDA6lvqZAw8PcsxTCnoeSC+UpfDRh7QsVjdYPDq9RBXO60gGye6/R J0Df2oYfB9WGRuSxVBhtqetxSUsMF/CnsM5oJJW94MyLWUWoBmBB7aMkXU95OqXDhFUI PR2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n21-20020a170906689500b0091452fdf543si14697773ejr.810.2023.03.24.19.12.58; Fri, 24 Mar 2023 19:13:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232020AbjCYB5s (ORCPT + 99 others); Fri, 24 Mar 2023 21:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbjCYB5r (ORCPT ); Fri, 24 Mar 2023 21:57:47 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBCB61BAC8 for ; Fri, 24 Mar 2023 18:57:44 -0700 (PDT) Received: from dggpemm500006.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Pk2F13LTtzSp2s; Sat, 25 Mar 2023 09:54:13 +0800 (CST) Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sat, 25 Mar 2023 09:57:40 +0800 Subject: Re: [PATCH 2/3] arm64: kdump: do not map crashkernel region specifically To: Baoquan He , CC: , , , , , , , References: <20230324131838.409996-1-bhe@redhat.com> <20230324131838.409996-3-bhe@redhat.com> From: "Leizhen (ThunderTown)" Message-ID: <36566d76-2e15-75c2-6c3b-2784aa8d2332@huawei.com> Date: Sat, 25 Mar 2023 09:57:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20230324131838.409996-3-bhe@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.3 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/3/24 21:18, Baoquan He wrote: > After taking off the protection functions on crashkernel memory region, > there's no need to map crashkernel region with page granularity during > linear mapping. > > With this change, the system can make use of block or section mapping > on linear region to largely improve perforcemence during system bootup > and running. > > Signed-off-by: Baoquan He > --- > arch/arm64/mm/mmu.c | 43 ------------------------------------------- > 1 file changed, 43 deletions(-) > > diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > index 6f9d8898a025..7556020a27b7 100644 > --- a/arch/arm64/mm/mmu.c > +++ b/arch/arm64/mm/mmu.c > @@ -510,21 +510,6 @@ void __init mark_linear_text_alias_ro(void) > PAGE_KERNEL_RO); > } > > -static bool crash_mem_map __initdata; > - > -static int __init enable_crash_mem_map(char *arg) > -{ > - /* > - * Proper parameter parsing is done by reserve_crashkernel(). We only > - * need to know if the linear map has to avoid block mappings so that > - * the crashkernel reservations can be unmapped later. > - */ > - crash_mem_map = true; > - > - return 0; > -} > -early_param("crashkernel", enable_crash_mem_map); > - > static void __init map_mem(pgd_t *pgdp) > { > static const u64 direct_map_end = _PAGE_END(VA_BITS_MIN); > @@ -554,16 +539,6 @@ static void __init map_mem(pgd_t *pgdp) > */ > memblock_mark_nomap(kernel_start, kernel_end - kernel_start); > > -#ifdef CONFIG_KEXEC_CORE > - if (crash_mem_map) { > - if (defer_reserve_crashkernel()) > - flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS; > - else if (crashk_res.end) > - memblock_mark_nomap(crashk_res.start, > - resource_size(&crashk_res)); > - } > -#endif > - > /* map all the memory banks */ > for_each_mem_range(i, &start, &end) { > if (start >= end) > @@ -590,24 +565,6 @@ static void __init map_mem(pgd_t *pgdp) > __map_memblock(pgdp, kernel_start, kernel_end, > PAGE_KERNEL, NO_CONT_MAPPINGS); > memblock_clear_nomap(kernel_start, kernel_end - kernel_start); > - > - /* > - * Use page-level mappings here so that we can shrink the region > - * in page granularity and put back unused memory to buddy system > - * through /sys/kernel/kexec_crash_size interface. > - */ > -#ifdef CONFIG_KEXEC_CORE > - if (crash_mem_map && !defer_reserve_crashkernel()) { > - if (crashk_res.end) { > - __map_memblock(pgdp, crashk_res.start, > - crashk_res.end + 1, > - PAGE_KERNEL, > - NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS); > - memblock_clear_nomap(crashk_res.start, > - resource_size(&crashk_res)); > - } > - } > -#endif > } > > void mark_rodata_ro(void) > Reviewed-by: Zhen Lei -- Regards, Zhen Lei