From patchwork Wed Oct 16 09:21:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 13838009 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 E1F0BD1AD32 for ; Wed, 16 Oct 2024 09:22:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 460506B007B; Wed, 16 Oct 2024 05:22:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4105A6B0082; Wed, 16 Oct 2024 05:22:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FEA06B0083; Wed, 16 Oct 2024 05:22:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 125406B007B for ; Wed, 16 Oct 2024 05:22:18 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C6564161B7D for ; Wed, 16 Oct 2024 09:22:06 +0000 (UTC) X-FDA: 82678923810.17.7143BBE Received: from mo-csw.securemx.jp (mo-csw1120.securemx.jp [210.130.202.131]) by imf26.hostedemail.com (Postfix) with ESMTP id 2DF7E140013 for ; Wed, 16 Oct 2024 09:22:07 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=toshiba.co.jp header.s=key2.smx header.b="tWF 8V+u"; dmarc=pass (policy=none) header.from=toshiba.co.jp; spf=pass (imf26.hostedemail.com: domain of nobuhiro1.iwamatsu@toshiba.co.jp designates 210.130.202.131 as permitted sender) smtp.mailfrom=nobuhiro1.iwamatsu@toshiba.co.jp ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729070488; a=rsa-sha256; cv=none; b=CJddZ9//kE6DUsuLO/l3b8HGoc+Wa2DKrTVUS6cjglXXqPkiruPPlLivUyJZIh6OgfUl+b QjhC0ZGYUeUEkLxhWa+5tclIXVqD9RYNMFuMt8vhhxbu/yDB3F09tgae9s7w53n6FmcnmV KzpmbzHN46VAoAanyyh7CKhu//xhX08= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=toshiba.co.jp header.s=key2.smx header.b="tWF 8V+u"; dmarc=pass (policy=none) header.from=toshiba.co.jp; spf=pass (imf26.hostedemail.com: domain of nobuhiro1.iwamatsu@toshiba.co.jp designates 210.130.202.131 as permitted sender) smtp.mailfrom=nobuhiro1.iwamatsu@toshiba.co.jp ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729070488; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=qhE12xtP1utBz3KE/XR3kA3Sdxa5zJDeKUNB9EJ0IHA=; b=z5gdF38bn8iedk1kruSYKa6fN0QSxnqqpmwFoDWo5Tc8NEUnEnalrjdFY6YARt7XMd3Zyk DrDDbRi6TqtD5jpdWFJSGb0FULt92ZvzsISay7pPpnv8CZd87jpHyaOyo04r2bO86hlHTg ZJVeiC2uySqBs5tUCLnD2xlZD7IUCs0= DKIM-Signature: v=1;a=rsa-sha256;c=relaxed/simple;d=toshiba.co.jp;h=From:To:Cc :Subject:Date:Message-Id;i=nobuhiro1.iwamatsu@toshiba.co.jp;s=key2.smx;t= 1729070518;x=1730280118;bh=Cym9k5YlG7MkxGTDpK6LrrZkim1QhFb6BtXygPQM6UQ=;b=tWF 8V+uSiuBsOFAQwXeWq+TFr3+fTCX32f5FPEQXLx5gILWCTiIXG+SdxkxnpIkqQGzQGuFyPvCJrRod qrJGcqIQdhzdnTctxCmamcwSpJHHGAgdb//u9uHr/hzeNI8VNlymE4xORcazywoUemRpS7xYnhOyZ aR1IpSewF2GZKJ8RulxecmofQk1R5MfO/imjySRrmsrZCgLaUF/ISpqmHTiQ2HwZY2gZgtKGEOSwj 48a0wMiRkK0qwecSZmw2TR6TsmaWMV+XCYAdRvvrEI/YBzkzA6CYvagUcMmW/PQcWNmzRo0WcjNBa 0NOVv08LEHvx4zfLsbfFo1pbkULUxlA==; Received: by mo-csw.securemx.jp (mx-mo-csw1120) id 49G9LwN91420583; Wed, 16 Oct 2024 18:21:58 +0900 X-Iguazu-Qid: 2rWgO3UeIOptYH2MiI X-Iguazu-QSIG: v=2; s=0; t=1729070517; q=2rWgO3UeIOptYH2MiI; m=+NNF/1Z/awk1aCmrD9LSgbn+Q1A5ZEvAqYYheHqgI3k= Received: from imx2-a.toshiba.co.jp (imx2-a.toshiba.co.jp [106.186.93.35]) by relay.securemx.jp (mx-mr1122) id 49G9Lupo013598 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Oct 2024 18:21:56 +0900 From: Nobuhiro Iwamatsu To: linux-mm@kvack.org, Andrew Morton Cc: linux-kernel@vger.kernel.org, yuji2.ishikawa@toshiba.co.jp, Nobuhiro Iwamatsu , Mike Rapoport Subject: [PATCH v2] mm: numa_clear_kernel_node_hotplug: Add NUMA_NO_NODE check for node id Date: Wed, 16 Oct 2024 18:21:01 +0900 X-TSB-HOP2: ON Message-Id: <1729070461-13576-1-git-send-email-nobuhiro1.iwamatsu@toshiba.co.jp> X-Mailer: git-send-email 2.7.4 X-Rspam-User: X-Rspamd-Queue-Id: 2DF7E140013 X-Rspamd-Server: rspam01 X-Stat-Signature: nzafhm49pxehcyii73bgbq9hhrbub4fd X-HE-Tag: 1729070527-55705 X-HE-Meta: U2FsdGVkX1/TdFSj0lUj+FxSAsgevzNW4Yard0uXablm/rV9hUdbkGx21mJUJvSUbm2x0vHnPo98Z7ka0zHI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3GDFo35mtFvBuFIRyQI6e7i6xrRa2sPGun/JrMwxNGXvxf+odiOlCieWjL6AAXqBn+MnmVHi7+dPrynaxZEezyiFQ== 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: The acquired memory blocks for reserved may include blocks outside of memory management. In this case, the nid variable is set to NUMA_NO_NODE (-1), so an error occurs in node_set(). This adds a check using numa_valid_node() to numa_clear_kernel_node_hotplug() that skips node_set() when nid is set to NUMA_NO_NODE. Fixes: 87482708210f ("mm: introduce numa_memblks") Cc: Mike Rapoport (Microsoft) Reviewed-by: Mike Rapoport (Microsoft) Suggested-by: Yuji Ishikawa Signed-off-by: Nobuhiro Iwamatsu Reviewed-by: Anshuman Khandual --- mm/numa_memblks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) v2: - Use numa_valid_node() instead of check. - Add Reviewed-by: Mike Rapoport (Microsoft) - Update description. - Drop RFC from subject. diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c index be52b93a9c58..a3877e9bc878 100644 --- a/mm/numa_memblks.c +++ b/mm/numa_memblks.c @@ -349,7 +349,7 @@ static void __init numa_clear_kernel_node_hotplug(void) for_each_reserved_mem_region(mb_region) { int nid = memblock_get_region_node(mb_region); - if (nid != MAX_NUMNODES) + if (numa_valid_node(nid)) node_set(nid, reserved_nodemask); }