Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp105624rdd; Mon, 8 Jan 2024 20:16:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGh0JVwfoJbL/CB7WdYlGhcyy9+r3THOmm8aHMAi2L/GVduYRrQtDMzyUg/rgbzlYDtDR0w X-Received: by 2002:a05:6a21:6d97:b0:197:3552:a208 with SMTP id wl23-20020a056a216d9700b001973552a208mr5541328pzb.14.1704773762101; Mon, 08 Jan 2024 20:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704773762; cv=none; d=google.com; s=arc-20160816; b=UJI2plowWihPShWe40X92QW2ETzSQ+VKC+lij4wrBjyRhwxOx62h6vnthdWecpoQn4 jIk7Ikol+njrwsevn17OKELZkKf8kxOXqEJw0+fmiV8RUY2ylOkcH6KHV2gbB6nDxUKG 283MGWtF+KSmfx3Op2UQ7eyKTvZy4l1zSzfkV0KGLCAtunnRwgwVvuDShu/lHvXxDikg J7r7anVkAvwujISkWD8h6rm0avQsKWiQ64RUu84C2SBsklfoOjo31aO5jc6OzQ9Ff/4a v6LfVF44+gFVNI6HcE9wKqnMTCy0B3qrI0i75ka0w4PyJ/WR/bAMs3gE4UKy6s3dCYDF fh5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=tSw7K0eKa+rkmheMsuNEcaUUHF23/o5NOYkMBGV0bTs=; fh=uOlxKWqHpapd0EP/7KrpVHcO2p9DSE2cukI3piXDXBY=; b=HauAGYatX7q9EzPSZae+Tsdn5heAea29n/SmazTKf3tCx8kO+S7nsDoc6YdwPhwYHk JstLJeyeuM0Vn51tFA8ymrEEKgX7UvasP8YR1udaHkF2jxIHePHDQK4g2EvToqO4iUDx p0F58mV+cWzcnc1PAEypQu2njEWtKmJb9/F8Rkhd7itdPH5YD9BOL+eyof2Hc99mWPFQ eXQZcHw1+mxAvnYXGRlwTP1jMF6OHIKvp3B9LjLZBm7q3dgL/F524wMURsCSRQpElMek PeKEiyVoQzl+WdUoVSBqYE5gcN6LVGOXnn0jejhsei0/qiip8B7n30Hcy464G18qOU7U U1cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id m186-20020a6326c3000000b005c69365abb9si831382pgm.697.2024.01.08.20.16.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 20:16:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-20372-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20372-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 02C91B22FB8 for ; Tue, 9 Jan 2024 04:15:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C6417612E; Tue, 9 Jan 2024 04:15:47 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96B896104 for ; Tue, 9 Jan 2024 04:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.48]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4T8Hdb36tCz1Q7Ps; Tue, 9 Jan 2024 12:14:59 +0800 (CST) Received: from dggpemd200001.china.huawei.com (unknown [7.185.36.224]) by mail.maildlp.com (Postfix) with ESMTPS id 2268618005E; Tue, 9 Jan 2024 12:15:42 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemd200001.china.huawei.com (7.185.36.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1258.28; Tue, 9 Jan 2024 12:15:41 +0800 From: Wupeng Ma To: , CC: , , Subject: [PATCH] efi: Disable mirror feature during crashkernel Date: Tue, 9 Jan 2024 12:15:36 +0800 Message-ID: <20240109041536.3903042-1-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemd200001.china.huawei.com (7.185.36.224) From: Ma Wupeng If system have no mirrored memory or use crashkernel.high while kernelcore=mirror is enabled in cmdline, during crashkernel, there will be limited mirrored memory and this usually lead to OOM. To solve this problem, disable mirror feature during crashkernel. Signed-off-by: Ma Wupeng --- mm/mm_init.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/mm_init.c b/mm/mm_init.c index 077bfe393b5e..513bad672708 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "internal.h" #include "slab.h" #include "shuffle.h" @@ -381,6 +382,11 @@ static void __init find_zone_movable_pfns_for_nodes(void) goto out; } + if (is_kdump_kernel()) { + pr_warn("The system is under kdump, ignore kernelcore=mirror.\n"); + goto out; + } + for_each_mem_region(r) { if (memblock_is_mirror(r)) continue; -- 2.25.1