From nobody Mon Feb 9 06:05:23 2026 Received: from zg8tmja2lje4os4yms4ymjma.icoremail.net (zg8tmja2lje4os4yms4ymjma.icoremail.net [206.189.21.223]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCD6923AE62 for ; Tue, 30 Dec 2025 09:28:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=206.189.21.223 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767086914; cv=none; b=JdhZvqciAwBZuaArVI1XNpmhCRMIKbDXHa9zT6P4k0qVOvAwga/9PCMy49YDuVweaOytioDm56NzrppwKrK16sQYAZa2ETD7ZUqnsrLHGIDGUjZK8b5BHiCSlDwcSUc56Ql0LbTMl9OqrQ0Xy3ywYV3tY2es7Hk8sXlAWuJbuGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767086914; c=relaxed/simple; bh=ujtmyTuPTizFC0PNTWOlKXouIuyyJklXlnqM9uamcFk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=E15YqjsPqDNaLKQt1FjEslX8LTrviaR6d81uvzoErHIOVZeLh54wA2/2jMpI30YsUIdaoljMzwadcb864k+5xAaxOOszKXAXcEdVLOeLbLOLMrsbEvdc1IezNdv2BA6bGsBOfFvfBjVH6zZ4RUq/ZhLXAKjukaXVdmyzG+/KjrE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phytium.com.cn; spf=pass smtp.mailfrom=phytium.com.cn; arc=none smtp.client-ip=206.189.21.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=phytium.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=phytium.com.cn Received: from prodtpl.icoremail.net (unknown [10.12.1.20]) by hzbj-icmmx-6 (Coremail) with SMTP id AQAAfwAnLycXm1NpkdWaAg--.50039S2; Tue, 30 Dec 2025 17:27:51 +0800 (CST) Received: from localhost.localdomain (unknown [218.76.62.144]) by mail (Coremail) with SMTP id AQAAfwC3DuwWm1NpEL8PAA--.14076S2; Tue, 30 Dec 2025 17:27:51 +0800 (CST) From: Cui Chao To: Andrew Morton Cc: Joanthan Cameron , Mike Rapoport , wangyinfeng@phytium.com.cn, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: numa_memblks: Identify the accurate NUMA ID of CFMW Date: Tue, 30 Dec 2025 17:27:50 +0800 Message-Id: <20251230092750.856060-1-cuichao1753@phytium.com.cn> X-Mailer: git-send-email 2.33.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: AQAAfwC3DuwWm1NpEL8PAA--.14076S2 X-CM-SenderInfo: pfxlux1drrlkut6sx5pwlxzhxfrphubq/1tbiAQAAAGlS4KwHiQAHs- Authentication-Results: hzbj-icmmx-6; spf=neutral smtp.mail=cuichao175 3@phytium.com.cn; X-Coremail-Antispam: 1Uk129KBjvJXoW7Jr4DWw18trW5uFy3tFW3GFg_yoW8JrW8pa 13XFy8XFWkGr17G3Z29w1DGw1IgF1fKF4YgFZrCws8ZF4Fgr18ZrWSqrn2vr4ktrWrA3ZY qF4Dta15Zw1kZFDanT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj DUYxn0WfASr-VFAU7a7-sFnT9fnUUIcSsGvfJ3UbIYCTnIWIevJa73UjIFyTuYvj4RJUUU UUUUU Content-Type: text/plain; charset="utf-8" In some physical memory layout designs, the address space of CFMW resides between multiple segments of system memory belonging to the same NUMA node. In numa_cleanup_meminfo, these multiple segments of system memory are merged into a larger numa_memblk. When identifying which NUMA node the CFMW belongs to, it may be incorrectly assigned to the NUMA node of the merged system memory. To address this scenario, accurately identifying the correct NUMA node can be achieved by checking whether the region belongs to both numa_meminfo and numa_reserved_meminfo. Signed-off-by: Cui Chao --- mm/numa_memblks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c index 5b009a9cd8b4..1ef037f0e0e0 100644 --- a/mm/numa_memblks.c +++ b/mm/numa_memblks.c @@ -573,7 +573,8 @@ int phys_to_target_node(u64 start) * Prefer online nodes, but if reserved memory might be * hot-added continue the search with reserved ranges. */ - if (nid !=3D NUMA_NO_NODE) + if (nid !=3D NUMA_NO_NODE && + meminfo_to_nid(&numa_reserved_meminfo, start) =3D=3D NUMA_NO_NODE) return nid; =20 return meminfo_to_nid(&numa_reserved_meminfo, start); --=20 2.33.0