From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF3B5298991 for ; Wed, 10 Jun 2026 01:45:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781055941; cv=none; b=CXuLvdtJXCtxX5tee7QTv6clpLusetv7HmeanruB6wBOY9Slpus79KzM38Gvj6MywlDW52jA+1Doy7zFGbDn49h+9FEKWheDgk0HnkHYi2VO9ydZ1rFcKkjQeHh7RF2x/QlNXH83Np2A2KLMJFbdg317EYmEbVyQfkOl8JXzSSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781055941; c=relaxed/simple; bh=4lm3filvyu7qL3c3XAtVgVtfMqNVCD7xcUCj3uoAlw0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kXYcvhePJpDYBN6373Mi7PzdsWkfSibQdE0FRXZSiuZgNRAEJApVOuyoioNHHCzk01Vpjf6eCCdF4jYBbBe10aUXBbYA9dy1CzDnnpS6he4feThMx83p8NJHXWEuuKDM3AR7JcE8wLx754VxUItUecjzzHZ/utzR4UTgI1E3Ycw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=R4ABMR3B; arc=none smtp.client-ip=209.85.160.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="R4ABMR3B" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-5177b1a7441so87143191cf.3 for ; Tue, 09 Jun 2026 18:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1781055933; x=1781660733; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HsslT2SHe3Ngpr6+flW/+aA6XcPRV1aWnG37ChpGzVM=; b=R4ABMR3BVqUKgpCrs5HX9Qx21n9we9fMMneuOfN+2o+j+SxTUqIzgsTId4RsIjLFur x3gzwUzxl3WWgUKUhOslcR3bUoaUaraetL/fYz39bUjDJK/2kn8aWeVfHWQXHWb94iqv 0ROGcQ3THu1iiunBAzWPX2G5b8RGEBCvgzVy6hFUXvhEdpqyg2rGomVXZSZ1X+6UGsIt mcmIymrI8zTBPAYRFQDu0iaDm37TgWM7juT+unyOA5BFtJA02qPKhjrdShUBWVixgXZ5 8n0ltGSw1FzMfaVk2+qfzRCvdlKNmuOJ7ksoQLVgOAWf5s4ctnHPgy9PmJUN9631joTK E0bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781055933; x=1781660733; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=HsslT2SHe3Ngpr6+flW/+aA6XcPRV1aWnG37ChpGzVM=; b=I7i3uOouGHqbnjIZPwK5ASNk3P6lSGNV1ovq4jDGVP3X1fb0MbVsH5Nw16lgMFygHG pkknN8hgcM2SlSK5BjygPs1Wsp2T9JS3qhLYzPiFUVR8mDnwgDRTJTHUVMJauzVdLL4N lyqf9zDX3nVyR2br4w+t0WxYc5Rx9S9Z81RESGmvhHIueE1JF0ruczxikt+kmsMSa3NX na6qazEBqT68G5S5vEiUqwoa2jDUJdgCMrbKR79XeQ6B3ciwdstxVRRX0/lYn+JAC9gF 6EsszSoWfxSdWrQd6M9eeNN1PyukEuUEutrtlUcYhO2xIMqTnP839J/ObG1jRNpB2I9k 4Ubw== X-Forwarded-Encrypted: i=1; AFNElJ8Tqf8ZlDziXeWXDi7DOlf2tllwZY/dczS0EPXxK8ZGFFRLmR+hNjGMGCYmjRgljXQloFhE1lq7OmMhsT8=@vger.kernel.org X-Gm-Message-State: AOJu0Yye7bBkvkkYRdvheNsGexHEbB2Fi/Cv1y56W1OVEKYhI4RX8sYg 1A/Dvz2vvShX09gGYAm+hQvinYSEBUeJn3KMRCofr0o+dcaEfIvQl3sv3c8t2keDz/M= X-Gm-Gg: Acq92OFVxztO5dALD+Tavq2fsq8NWGtigoxduKVZslCbGHWbJZbfzb42yOwR+0F5Qey qEoIHgiT6Ot9Db70bNP8386KZpQR7av1uiSkL5mlMsRZp97leEnsSgkOW2qQAmAc5RhHIO86I55 bSs7MPXwY44pOu1Oq7FVP/MbyFVLU5uQLm9EIm0c+Punz2x0UCKMWZ3skDK1E/GFTrPzlLLkf4P kJ0nKcrAtRJnQYw9KJmgESO0rJqxHDp5s2FCU15rOuD1/XnAxAkUO/QbGmf8W6JgLAbowrVlBGI lTexnFS+2Q/MEjbdNmw2bhmOG7lfiOc/C3Cn2ImMF51yOQBwEVzPvXyWLoHzPLWP+4/Phc/qSnI w3Aa2BTDSL/tK5j5DE+MWTKo57/JRTEeaD+lcBEL3OwhLAPOwhGYLJ5myF3aW+adA2Yus1Jddr+ EeGNIeMP1ZSOepfCvCFKxymwtHH2o8BvoboUmNP23uy6uwksj3LxQ8O3KhFxTnb87qv100sO5Ob KkcskkEr6U5SJj7ONEoyIw= X-Received: by 2002:ac8:59cd:0:b0:517:b68a:8d84 with SMTP id d75a77b69052e-517c22529e3mr130851341cf.56.1781055932831; Tue, 09 Jun 2026 18:45:32 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F.lan (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-51775c07e91sm205923261cf.4.2026.06.09.18.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 18:45:31 -0700 (PDT) From: Gregory Price To: linux-mm@kvack.org Cc: x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, driver-core@lists.linux.dev, kernel-team@meta.com, corbet@lwn.net, skhan@linuxfoundation.org, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, rafael@kernel.org, lenb@kernel.org, gregkh@linuxfoundation.org, dakr@kernel.org, akpm@linux-foundation.org, rppt@kernel.org, rdunlap@infradead.org, feng.tang@linux.alibaba.com, dapeng1.mi@linux.intel.com, elver@google.com, kuba@kernel.org, ebiggers@kernel.org, lirongqing@baidu.com, paulmck@kernel.org, gourry@gourry.net, dave.jiang@intel.com, jic23@kernel.org, xueshuai@linux.alibaba.com, kai.huang@intel.com Subject: [RFC PATCH 3/3] acpi/numa: add CONFIG_ACPI_NUMA_ADD_CFMWS_NODES Date: Tue, 9 Jun 2026 21:45:17 -0400 Message-ID: <20260610014517.253609-4-gourry@gourry.net> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260610014517.253609-1-gourry@gourry.net> References: <20260610014517.253609-1-gourry@gourry.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit CXL is intended to be a programmable topology, and a single CXL Fixed Memory Window (CFMWS) may back memory that a driver wants to split across multiple NUMA nodes for tiering or isolation. Those nodes must exist at __init time to be usable later. Add CONFIG_ACPI_NUMA_ADD_CFMWS_NODES, the number of additional standby NUMA nodes to reserve per CEDT CFMWS entry. acpi_parse_cfmws() records the per-window count, which is folded into the standby request on successful acpi_numa_init(). Signed-off-by: Gregory Price --- drivers/acpi/numa/Kconfig | 20 ++++++++++++++++++++ drivers/acpi/numa/srat.c | 13 +++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/numa/Kconfig b/drivers/acpi/numa/Kconfig index ecf27bf45e5b..65d7eb9a4022 100644 --- a/drivers/acpi/numa/Kconfig +++ b/drivers/acpi/numa/Kconfig @@ -14,6 +14,26 @@ config ACPI_HMAT performance attributes through the node's sysfs device if provided. +config ACPI_NUMA_ADD_CFMWS_NODES + int "Additional standby NUMA nodes per CEDT CFMWS entry" + depends on ACPI_NUMA + range 0 4 + default 0 + help + Number of additional standby NUMA nodes to reserve per CEDT + CXL Fixed Memory Window Structure (CFMWS) entry. + + By default ACPI reserves 1 NUMA node per unique PXM entry in + the SRAT, or 1 node for a CFMWS without SRAT mappings. + + Setting this > 0 reserves additional standby nodes per CFMWS + that drivers can claim at runtime via + numa_request_exclusive_node(). This is useful for CXL drivers + that want to place memory on distinct NUMA nodes within the + same CXL Fixed Memory Window. + + Set to 0 (default) to disable. + config ACPI_NUMA_STANDBY_NODES int "Additional standby NUMA nodes for runtime claiming" depends on ACPI_NUMA diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index d7b0e4ece610..6c54d5f0cf0a 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -354,6 +354,7 @@ static int __init acpi_parse_slit(struct acpi_table_header *table) } static int parsed_numa_memblks __initdata; +static int cfmws_standby_count __initdata; static int __init acpi_parse_memory_affinity(union acpi_subtable_headers *header, @@ -454,7 +455,7 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, * window. */ if (!numa_fill_memblks(start, end)) - return 0; + goto standby_nodes; /* No SRAT description. Create a new node. */ node = acpi_map_pxm_to_node(*fake_pxm); @@ -473,6 +474,11 @@ static int __init acpi_parse_cfmws(union acpi_subtable_headers *header, /* Set the next available fake_pxm value */ (*fake_pxm)++; + +standby_nodes: + /* Request any standby nodes (created after numa_emulation runs) */ + cfmws_standby_count += CONFIG_ACPI_NUMA_ADD_CFMWS_NODES; + return 0; } @@ -607,6 +613,8 @@ int __init acpi_numa_init(void) if (acpi_disabled) return -EINVAL; + cfmws_standby_count = 0; + /* * Should not limit number with cpu num that is from NR_CPUS or nr_cpus= * SRAT cpu entries could have different order with that in MADT. @@ -666,7 +674,8 @@ int __init acpi_numa_init(void) return -ENOENT; /* Request any standby nodes (created after numa emulation) */ - numa_request_standby_count(CONFIG_ACPI_NUMA_STANDBY_NODES); + numa_request_standby_count(CONFIG_ACPI_NUMA_STANDBY_NODES + + cfmws_standby_count); return 0; } -- 2.54.0