From patchwork Tue Jan 9 04:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mawupeng X-Patchwork-Id: 13514283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B482FC46CD2 for ; Tue, 9 Jan 2024 04:15:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 214838D0002; Mon, 8 Jan 2024 23:15:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C5718D0001; Mon, 8 Jan 2024 23:15:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0B3AE8D0002; Mon, 8 Jan 2024 23:15:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id EBFCA8D0001 for ; Mon, 8 Jan 2024 23:15:48 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B8062402A2 for ; Tue, 9 Jan 2024 04:15:48 +0000 (UTC) X-FDA: 81658459176.11.BDEA55C Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf08.hostedemail.com (Postfix) with ESMTP id E461A16000D for ; Tue, 9 Jan 2024 04:15:45 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704773747; a=rsa-sha256; cv=none; b=VjgOpZnFxbOjIsx9QtauDGqs2BAjGEfRfG3HY7//WM2w7VC0qS7OzKnyBMNp/I09gk5hiY ZwEa09S5sJ8BVx31EbKUfBR1qHyk0h8Qx6kJBV7P1OKlWPWk/mVMKCvpL6SWmtp42ZNZnt ouhnCi5jPUCavD0TTziexJbzzb4pJrc= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf08.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704773747; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=tSw7K0eKa+rkmheMsuNEcaUUHF23/o5NOYkMBGV0bTs=; b=sXVoZ9Zy3SpssPQQ5VJcJjSRhbj6/jE6N8SPyMZoiok1b0S9uiOjRz7hMmpiaxMr+hxLLg Cr8IWVfbyazWZqp0TQWkHRYIGNkkezwu7o15/Dq+JH6s7hS+ipaeECk2+Fuob9qxoGYxLZ Q0PCw3cq6pW1122SzTemd7b4u8K9H4I= 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 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemd200001.china.huawei.com (7.185.36.224) X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E461A16000D X-Stat-Signature: y3d8bxjjhp1aupdfwtz41rf3jiiiiddn X-Rspam-User: X-HE-Tag: 1704773745-4063 X-HE-Meta: U2FsdGVkX19/2oO6vsLJq8rmYioZZ5/4bXvDqCiwJov1rBDySazFVPUVUzO0mGXCB+uh/pDJ6pb0Vvr49bjywcnigATgD60Ugnp8TYaTsSXMTLc6k7PS8C1mi82CH0jgv7XuZI1JrkYYTX2Lf/xcv78Z9IOvKoIYpFQY0dERED/AAR1zfsPWiqUi+oDa+UnuVWW1mWQYqgbUor4FgCjBrFapw8PKCNgg9CyRYBfxP6kTvuJxVnmdtz2fsg0wY5X+07aHbTh4EZFMr8vIp8hcuN+Yat5Xl5weHFmfd51jxNjo8hU95/4HhCBdoMwW5jS8ZIT8zShYTP7YF9iuYUZLLH+3b3p38FvR5OjkFVe0jtVaM4EiDH90pdpX48x1JgVVpA4anmd5kV7zGxj8lYtkgybfaQ94qENqw0kaCQ3LAv9Ix4qFQVN7h19JyXwX2N/ylTSoSVHlr+rxV54I6CL09iW8M+IIduGRQ7CcGob73Whl2D9OzjgAhJ5YDJtBKL1bDpDq0XJ39ziof0m6hGuFw4FZ3RN44oaAeJBvZFTkP1LuUo68IGYOEPAYNWCRY0Q3BrLkQ1b+h0fFuEB1HVoz9NRar/LVpDApRpsT3tGwYS+SJUkYYg+fYvf6HPVYzBD13IS//bsDCCIe/X2FyC8vCZ7MguNjczNZnjSeRc0CNqyUFkhaoKXQGz3vNZVJIdQv7udySojVc3ABl2hoGi51UqrPasLfR//NXm9OBsrlhlMg/dQLBzfZXHNE9i9XpXHT8Qja360zxx/9rbzhttU9OeGTkfnTJZi7nICn9v2+zBAOcMvHfmkJ+GEn/zoA0CUatLeva4etn3UHLhzkeTA08DAx4VYtkU+9bLEaOpdRur1/88HJhnUhZKR94P4FPHRIxym6OFrx1FM2vM6bBx1o4QGawxuOTQEYrmI+z3fzGrQhZ76P0VJPFnoeEaUCVQupk335oZDu/ZiqBQ0p3PU 4vRF1bqL AW92nlusfIclt6J6aWp1QeuMjLSE7dp24xqiqSe46m7SUUpuCvIyLH+K63qAKjB4EKwY9LKz9oXR735QlwACjiRX6lbdLpGAP3zzM9VQGRetOwC9x876HGubuibe4ZQDLP96u8RkwoA4qwcSFIm3r+49+lKCTvw3Ja/1oThtXAEDa3J0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 Acked-by: Mike Rapoport (IBM) --- 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;