From patchwork Wed Oct 16 05:37:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 13837741 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 0E57FD2069A for ; Wed, 16 Oct 2024 05:37:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 452B86B007B; Wed, 16 Oct 2024 01:37:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 403216B0082; Wed, 16 Oct 2024 01:37:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2F1746B0089; Wed, 16 Oct 2024 01:37:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 104A76B007B for ; Wed, 16 Oct 2024 01:37:46 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B9E42121A97 for ; Wed, 16 Oct 2024 05:37:36 +0000 (UTC) X-FDA: 82678358280.05.45B89EA Received: from mo-csw.securemx.jp (mo-csw1801.securemx.jp [210.130.202.135]) by imf21.hostedemail.com (Postfix) with ESMTP id 6BA951C0017 for ; Wed, 16 Oct 2024 05:37:26 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=toshiba.co.jp header.s=key2.smx header.b="GR3 lrzC"; spf=pass (imf21.hostedemail.com: domain of nobuhiro1.iwamatsu@toshiba.co.jp designates 210.130.202.135 as permitted sender) smtp.mailfrom=nobuhiro1.iwamatsu@toshiba.co.jp; dmarc=pass (policy=none) header.from=toshiba.co.jp ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729056990; 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=F/IliwX3yaDNfEP0c0lktxfFmMv/GDsT+y4Jmy03JIA=; b=VKCOXvy36xKMn0gHKmjPRnaZJtZsTKFUld31P5yDIJy2IFjFY3jzmtsvNwIzFDvR2N+ymy WWqy7WAC543MBLIophjqUz85r3oKqg09rHhFptB53HodGljP1uo0F0vQc8ypUJe2prc+Ww 4VzfnxhRSsdTTFMGp7J/5frRIVKKB1w= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=toshiba.co.jp header.s=key2.smx header.b="GR3 lrzC"; spf=pass (imf21.hostedemail.com: domain of nobuhiro1.iwamatsu@toshiba.co.jp designates 210.130.202.135 as permitted sender) smtp.mailfrom=nobuhiro1.iwamatsu@toshiba.co.jp; dmarc=pass (policy=none) header.from=toshiba.co.jp ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729056990; a=rsa-sha256; cv=none; b=2JxK3F/n1mYfpEokJ6jeuGVowuFvEin8deOamRNG0XI6CixTMi8bBRY3k2H8g3AFHTtHdp y0Idaa9aniKrzM0RUCzRhMRrhgpkBqAikkUlor56WhaTxQyQfpaVjbuW9sGl5IrgGcCxH9 z1X+G2+Vz83M3rqotQQuyvgCH9KqVQ8= 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= 1729057047;x=1730266647;bh=IJqFbMl21b/RVLRiQT27dPMDBeuJTsKV7i1Cv3+IhJo=;b=GR3 lrzCYW5J3hMvrSD2mBwUH0gfCviWal6XccoHYfejMqEsiSY8pl+aGzsIf2A6KTZTaJlkIHpMsTQXS sDKm/PQKMx9yihd8EKuoNODSiXkmSs2x0qujjNnrLBnQG8HElAz1/lD9lOr8g5FdRPBRncilr9e+b 5I8FGJGUsbVrZbHxY0A3X3oL3s7EtPp5byJtZSmJ60xg32u6yA/8ICXWz0Oan0BOrY8vNzbCoNE2c z87PYaq9QV6MKPFLXHje6abnzxx3lLim+LuteGwuf2hW6LOOTG10KgEO8QgzFCsUDOGysKkMRaRIY uinoxBrjJU5KSPd68voSnn5c6f8a/rw==; Received: by mo-csw.securemx.jp (mx-mo-csw1801) id 49G5bRR83032571; Wed, 16 Oct 2024 14:37:27 +0900 X-Iguazu-Qid: 2yAacTOYEzPWnkLEg6 X-Iguazu-QSIG: v=2; s=0; t=1729057047; q=2yAacTOYEzPWnkLEg6; m=QCwC1FNAq8f4EUqZraX48VWMIYM9QXjxgerjrrR7UzA= Received: from imx12-a.toshiba.co.jp ([38.106.60.135]) by relay.securemx.jp (mx-mr1803) id 49G5bPFN1579837 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 16 Oct 2024 14:37:26 +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 RFC] mm: numa_clear_kernel_node_hotplug: Add NUMA_NO_NODE check for node id Date: Wed, 16 Oct 2024 14:37:10 +0900 X-TSB-HOP2: ON Message-Id: <1729057030-4625-1-git-send-email-nobuhiro1.iwamatsu@toshiba.co.jp> X-Mailer: git-send-email 2.7.4 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 6BA951C0017 X-Stat-Signature: 9aomopeux8umy9jurnfm5qw1z7h1ehif X-HE-Tag: 1729057046-483878 X-HE-Meta: U2FsdGVkX1/uHb0QNJ63BXtNqznkwGd/U15LlZZi+X+v2xP/4vUkD/DIlSF6a7WDJXWXWNR18Nwp+g1ayIMLhtnxzcWxZIb3ZXrlDZCxG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VNfGIarGzdIKu874KYZCGqLurDB5hfQ+fixHSgHFk46E47LG4h3BxL6tpg+AUxNjOqkxjjMxA== 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 to numa_clear_kernel_node_hotplug that skips node_set when nid is set to NUMA_NO_NODE. Fixes: 87482708210f ("mm: introduce numa_memblks") Suggested-by: Yuji Ishikawa Signed-off-by: Nobuhiro Iwamatsu Cc: Mike Rapoport (Microsoft) Reviewed-by: Mike Rapoport (Microsoft) --- mm/numa_memblks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c index be52b93a9c58..b982f9260872 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 (nid != NUMA_NO_NODE && nid != MAX_NUMNODES) node_set(nid, reserved_nodemask); }