Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196225/?format=api
{ "id": 2196225, "url": "http://patchwork.ozlabs.org/api/patches/2196225/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260213060347.2389818-2-cuichao1753@phytium.com.cn/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260213060347.2389818-2-cuichao1753@phytium.com.cn>", "list_archive_url": null, "date": "2026-02-13T06:03:47", "name": "[v4,1/1] mm: numa_memblks: Identify the accurate NUMA ID of CFMW", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "4ace09df86a8f2a748f1c7d13e276dfba177cd2e", "submitter": { "id": 92627, "url": "http://patchwork.ozlabs.org/api/people/92627/?format=api", "name": "Cui Chao", "email": "cuichao1753@phytium.com.cn" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260213060347.2389818-2-cuichao1753@phytium.com.cn/mbox/", "series": [ { "id": 492062, "url": "http://patchwork.ozlabs.org/api/series/492062/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=492062", "date": "2026-02-13T06:03:46", "name": "Identify the accurate NUMA ID of CFMW", "version": 4, "mbox": "http://patchwork.ozlabs.org/series/492062/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196225/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196225/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)", "hzbj-icmmx-6; spf=neutral smtp.mail=cuichao175\n 3@phytium.com.cn;" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fC1ps0GSXz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 17:04:51 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vqmHk-0002y1-3I; Fri, 13 Feb 2026 01:04:12 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <cuichao1753@phytium.com.cn>)\n id 1vqmHh-0002xc-Vu\n for qemu-devel@nongnu.org; Fri, 13 Feb 2026 01:04:09 -0500", "from sgoci-sdnproxy-4.icoremail.net ([129.150.39.64])\n by eggs.gnu.org with esmtp (Exim 4.90_1)\n (envelope-from <cuichao1753@phytium.com.cn>) id 1vqmHf-0000ud-0m\n for qemu-devel@nongnu.org; Fri, 13 Feb 2026 01:04:09 -0500", "from prodtpl.icoremail.net (unknown [10.12.1.20])\n by hzbj-icmmx-6 (Coremail) with SMTP id AQAAfwC3jETNvo5ptlZNAA--.56725S2;\n Fri, 13 Feb 2026 14:03:57 +0800 (CST)", "from localhost.localdomain (unknown [218.76.62.144])\n by mail (Coremail) with SMTP id AQAAfwAHXuvEvo5pWw0bAA--.32545S3;\n Fri, 13 Feb 2026 14:03:49 +0800 (CST)" ], "From": "Cui Chao <cuichao1753@phytium.com.cn>", "To": "Andrew Morton <akpm@linux-foundation.org>", "Cc": "Jonathan Cameron <Jonathan.Cameron@huawei.com>,\n Mike Rapoport <rppt@kernel.org>, Wang Yinfeng <wangyinfeng@phytium.com.cn>,\n dan.j.williams@intel.com,\n Pratyush Brahma <pratyush.brahma@oss.qualcomm.com>,\n Gregory Price <gourry@gourry.net>, David Hildenbrand <david@kernel.org>,\n linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org,\n linux-mm@kvack.org, qemu-devel@nongnu.org, stable@vger.kernel.org,\n Jonathan Cameron <jonathan.cameron@huawei.com>", "Subject": "[PATCH v4 1/1] mm: numa_memblks: Identify the accurate NUMA ID of\n CFMW", "Date": "Fri, 13 Feb 2026 14:03:47 +0800", "Message-Id": "<20260213060347.2389818-2-cuichao1753@phytium.com.cn>", "X-Mailer": "git-send-email 2.33.0", "In-Reply-To": "<20260213060347.2389818-1-cuichao1753@phytium.com.cn>", "References": "<20260213060347.2389818-1-cuichao1753@phytium.com.cn>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-CM-TRANSID": "AQAAfwAHXuvEvo5pWw0bAA--.32545S3", "X-CM-SenderInfo": "pfxlux1drrlkut6sx5pwlxzhxfrphubq/1tbiAQAFAGmONAkAtAAEsu", "X-Coremail-Antispam": "1Uk129KBjvJXoWxCr4rGryDtrWxuFyDAw43ZFb_yoW5CFW5pa\n 1agFZYgF4kJryxGFs7u3WUAw1IqFnYkF45GFZrCwnxZa1Ygw1Uuryavr1FvFn7tryfCF1r\n XF4qy3WYvw1UZaDanT9S1TB71UUUUj7qnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj\n DUYxn0WfASr-VFAU7a7-sFnT9fnUUIcSsGvfJ3UbIYCTnIWIevJa73UjIFyTuYvj4RJUUU\n UUUUU", "Received-SPF": "pass client-ip=129.150.39.64;\n envelope-from=cuichao1753@phytium.com.cn; helo=sgoci-sdnproxy-4.icoremail.net", "X-Spam_score_int": "-18", "X-Spam_score": "-1.9", "X-Spam_bar": "-", "X-Spam_report": "(-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H3=0.001,\n RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "In some physical memory layout designs, the address space of CFMW (CXL\nFixed Memory Window) resides between multiple segments of system memory\nbelonging to the same NUMA node. In numa_cleanup_meminfo, these multiple\nsegments of system memory are merged into a larger numa_memblk. When\nidentifying which NUMA node the CFMW belongs to, it may be incorrectly\nassigned to the NUMA node of the merged system memory.\n\nWhen a CXL RAM region is created in userspace, the memory capacity of\nthe newly created region is not added to the CFMW-dedicated NUMA node.\nInstead, it is accumulated into an existing NUMA node (e.g., NUMA0\ncontaining RAM). This makes it impossible to clearly distinguish\nbetween the two types of memory, which may affect memory-tiering\napplications.\n\nExample memory layout:\n\nPhysical address space:\n 0x00000000 - 0x1FFFFFFF System RAM (node0)\n 0x20000000 - 0x2FFFFFFF CXL CFMW (node2)\n 0x40000000 - 0x5FFFFFFF System RAM (node0)\n 0x60000000 - 0x7FFFFFFF System RAM (node1)\n\nAfter numa_cleanup_meminfo, the two node0 segments are merged into one:\n 0x00000000 - 0x5FFFFFFF System RAM (node0) // CFMW is inside the range\n 0x60000000 - 0x7FFFFFFF System RAM (node1)\n\nSo the CFMW (0x20000000-0x2FFFFFFF) will be incorrectly assigned to node0.\n\nTo address this scenario, accurately identifying the correct NUMA node\ncan be achieved by checking whether the region belongs to both\nnuma_meminfo and numa_reserved_meminfo.\n\nWhile this issue is only observed in a QEMU configuration, and no known\nend users are impacted by this problem, it is likely that some firmware\nimplementation is leaving memory map holes in a CXL Fixed Memory Window.\nCXL hotplug depends on mapping free window capacity, and it seems to be\nonly a coincidence to have not hit this problem yet.\n\nFixes: 779dd20cfb56 (\"cxl/region: Add region creation support\")\nSigned-off-by: Cui Chao <cuichao1753@phytium.com.cn>\nCc: <stable@vger.kernel.org>\nReviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>\nReviewed-by: Gregory Price <gourry@gourry.net>\nReviewed-by: Dan Williams <dan.j.williams@intel.com>\n---\n mm/numa_memblks.c | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)", "diff": "diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c\nindex 5b009a9cd8b4..0892d532908c 100644\n--- a/mm/numa_memblks.c\n+++ b/mm/numa_memblks.c\n@@ -568,15 +568,16 @@ static int meminfo_to_nid(struct numa_meminfo *mi, u64 start)\n int phys_to_target_node(u64 start)\n {\n \tint nid = meminfo_to_nid(&numa_meminfo, start);\n+\tint reserved_nid = meminfo_to_nid(&numa_reserved_meminfo, start);\n \n \t/*\n-\t * Prefer online nodes, but if reserved memory might be\n-\t * hot-added continue the search with reserved ranges.\n+\t * Prefer online nodes unless the address is also described\n+\t * by reserved ranges, in which case use the reserved nid.\n \t */\n-\tif (nid != NUMA_NO_NODE)\n+\tif (nid != NUMA_NO_NODE && reserved_nid == NUMA_NO_NODE)\n \t\treturn nid;\n \n-\treturn meminfo_to_nid(&numa_reserved_meminfo, start);\n+\treturn reserved_nid;\n }\n EXPORT_SYMBOL_GPL(phys_to_target_node);\n \n", "prefixes": [ "v4", "1/1" ] }