From nobody Mon Apr 13 21:03:41 2026 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 1EC9F3890FC for ; Wed, 4 Mar 2026 08:06:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772611617; cv=none; b=KoF1VqOK1YAKQQYej/fOCLd/H92aVTPld4X9XCJjLNEETKxiwzhawvvLX00yGApZFlWEYGLOr7eGRunyVjBbQSTqcPCXgljYlb+RYFrBHUMKMZi+JQWnjZmH+wFh+Pn3tL5kC0UoDgFWBiVyszOuMJMyespm8BztuzCI+xcdYK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772611617; c=relaxed/simple; bh=gIVQIjL6KWNp/N7IGQCVodqKY+vMRD57PEUjkJG2F/E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RnJMPHusXr/DVIygMtwDe/kL0WltiaiCR6MCBQBQ/ppNcGGNK/H/G7BFFf8O0L8kYQnu+sNG2/jMJRuQNJYQKaCnmIi6Es4EftwrxaDO0ZvjurnNPn9CfQCVcZVDRAXsrRGcELKuKYhMVaDRgCtJynYS3/IS0/vo+6PcSlf9SoA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=shopee.com; spf=pass smtp.mailfrom=shopee.com; dkim=pass (2048-bit key) header.d=shopee.com header.i=@shopee.com header.b=hHiJUJWz; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=shopee.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shopee.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=shopee.com header.i=@shopee.com header.b="hHiJUJWz" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-8274936d2c0so6448552b3a.3 for ; Wed, 04 Mar 2026 00:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shopee.com; s=shopee.com; t=1772611615; x=1773216415; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=r6eoY4SiH0kcADzF/tE6vWrQnAgRLMu3ultuUPQsFDg=; b=hHiJUJWz0nENmn7ihAIfl3aKwG9aNu1tRJO/hWK71lZ96W1kuITNoRNpI+sFWHnxQr h36TVqi4GielPZbPJLxYJ9FHdn5bpUt0ly80967XZXW/8XMYPDU3pazNUqkbImf1lyDL YDBtYIv65LE6INFYnvcVFWEZ7GoSezmZkXcrClVkGy1asZAD+7Ek2R8vmfGw0V1U9aau wnI4Lh7cI+eveuSQfuF9Oh3Acmh5jsFIr8CaTz/FF91RQ1258t6/OFvbOP0y8oyMb4Nh 9zr910FesIfnkZN58D7lXPQyQHkee84uuEZs3wpp7Mg+UaJh+SjkiqahS5GcXVrRgCmP pAaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772611615; x=1773216415; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=r6eoY4SiH0kcADzF/tE6vWrQnAgRLMu3ultuUPQsFDg=; b=P5YmiJPByPBoM1BRS1eSIAHoQPqtvLavBo1r6kgHT13gfkHweZWyJp5wzKuLHWJoGt DHEVgZXQlv0N4nRSodTAEETahYnKg4Fy8GudVnZeGqlQwDnnFOlAGUmEAPhUo1MAVIsJ 75HDKDo6D14biUBGbGqjOhdg4QHJvmHV6eLwWdkY0Yfx4qqKqvDg67hXN/g1d6CN2gRt FazZv9gdJJ/Bt0uJdKxBe3rb44JUO2YtMPdNzyARqnnwRys3Ij4uIUf5BZ2LOCgWhFj7 50tcXvNgY/fovuA8gYnS/1XaDmwjCcvURkzyTA1jaDptXZSNmIYlj2KsRbwrezVnbsmM NAVQ== X-Forwarded-Encrypted: i=1; AJvYcCU7Guet/YsUyNB2yG7XSdqa7lwbXJE8DJGrzWIOdVTV8T8yw2qX/8KddSovFJK28vs0tXUXv+rbYTjhMz0=@vger.kernel.org X-Gm-Message-State: AOJu0YzCjO4z6f2KprSeRlRnYn3qfbx37vMqmeUgqjSH8CixvMLuJUOt 3aUEZ/CdRQBgyBvY+vGbnM6IP6Y6AjLr0BgB30SzV4fVO3Rl9DNFT57OwuB5bANHbJ8= X-Gm-Gg: ATEYQzwUcEe5HUVC8564souFZbOiMEW0jxighnpj+GKHScNdPnQ6CENnzi7+AnS4lbE mwtl7B52sObxfTUO9GTumVmOd5yo+Y2FRUZqnILg1LXRqh0ZHfHXzfXy64BpGJt/6uMrMB2QR+2 Z1Dw4N0Rbbcxog8EBXiUrSIWHu6Cvi5K0fKKRxUmpQaHqDHTw4mGT1OvZ3EqKg9YjU1Y4O6X0tF 60YRoH01XfxkMwwetpmLF97VZt1E+6p8gcdb7pUPyvJSNUolWjCoXiOlzX8Lh8nNj9CHBWheqK6 5OrI3pVjeAi9dbZHpPShWmkPgjNg5Ik7GG/DC/wNVEzj8iaeIUp6WPwEVWCTd5J9qClaqkZoxLG JOwirciYn7/IXiU9mSWwt6Bq5rcAZHt6M9G1omoNQKowJgoPfnIpXLjN480Wr1OBvyBMyx3IJsk Qo5FvD/HJiJAIgg9K2d7TRLfQnbomGKn5+NB4bgYrCyCBis1Q= X-Received: by 2002:a05:6a20:3d8b:b0:394:6159:1758 with SMTP id adf61e73a8af0-3982dd69b41mr1132055637.8.1772611615452; Wed, 04 Mar 2026 00:06:55 -0800 (PST) Received: from localhost.localdomain ([147.136.157.0]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ae54136b28sm76817775ad.73.2026.03.04.00.06.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 00:06:55 -0800 (PST) From: Haifeng Xu To: rafael@kernel.org, lenb@kernel.org, dan.j.williams@intel.com, jonathan.cameron@huawei.com Cc: dave@stgolabs.net, dave.jiang@intel.com, alison.schofield@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Haifeng Xu Subject: [PATCH] ACPI: add a boot parameter to disable parsing CFMWS during NUMA init Date: Wed, 4 Mar 2026 16:06:47 +0800 Message-ID: <20260304080647.169434-1-haifeng.xu@shopee.com> X-Mailer: git-send-email 2.43.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 Content-Type: text/plain; charset="utf-8" For the machine Intel(R) Xeon(R) 6746E that supports CXL memory, the possible nodes are 20 (0-19). However, only two numa nodes (0-1) have memory and the rest nodes (2-19) detected by CEDT are memoryless. The problems is that when creating many pods, the shrinker map size needs to be expanded for all memory cgroups in expand_shrinker_info(). If the number of possible nodes is too large, the holding time of shrinker lock grows significantly. In this case, there is no CXL memory inserted in the machine, those memoryless nodes are useless for us, so there is no need to set them in 'numa_nodes_parsed'. After disabling parsing CFMWS, the pod creation time is reduced from over 10 minutes to approximately 150 seconds in our internal test. Signed-off-by: Haifeng Xu --- arch/x86/mm/numa.c | 2 ++ drivers/acpi/numa/srat.c | 29 ++++++++++++++++++++++------- include/acpi/acpi_numa.h | 6 ++++++ 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c index 7a97327140df..b127bb65d360 100644 --- a/arch/x86/mm/numa.c +++ b/arch/x86/mm/numa.c @@ -37,6 +37,8 @@ static __init int numa_setup(char *opt) disable_srat(); if (!strncmp(opt, "nohmat", 6)) disable_hmat(); + if (!strncmp(opt, "nocfmws", 7)) + disable_cfmws(); return 0; } early_param("numa", numa_setup); diff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c index aa87ee1583a4..8716d70043fe 100644 --- a/drivers/acpi/numa/srat.c +++ b/drivers/acpi/numa/srat.c @@ -31,6 +31,7 @@ static int node_to_pxm_map[MAX_NUMNODES] =20 unsigned char acpi_srat_revision __initdata; static int acpi_numa __initdata; +static int cfmws_numa __initdata; =20 static int last_real_pxm; =20 @@ -39,6 +40,12 @@ void __init disable_srat(void) acpi_numa =3D -1; } =20 +void __init disable_cfmws(void) +{ + cfmws_numa =3D -1; +} + + int pxm_to_node(int pxm) { if (pxm < 0 || pxm >=3D MAX_PXM_DOMAINS || numa_off) @@ -313,6 +320,12 @@ int __init srat_disabled(void) return acpi_numa < 0; } =20 +int __init cfmws_disabled(void) +{ + return cfmws_numa < 0; +} + + __weak int __init numa_fill_memblks(u64 start, u64 end) { return NUMA_NO_MEMBLK; @@ -648,14 +661,16 @@ int __init acpi_numa_init(void) */ =20 /* fake_pxm is the next unused PXM value after SRAT parsing */ - for (i =3D 0, fake_pxm =3D -1; i < MAX_NUMNODES; i++) { - if (node_to_pxm_map[i] > fake_pxm) - fake_pxm =3D node_to_pxm_map[i]; + if (!cfmws_disabled()) { + for (i =3D 0, fake_pxm =3D -1; i < MAX_NUMNODES; i++) { + if (node_to_pxm_map[i] > fake_pxm) + fake_pxm =3D node_to_pxm_map[i]; + } + last_real_pxm =3D fake_pxm; + fake_pxm++; + acpi_table_parse_cedt(ACPI_CEDT_TYPE_CFMWS, acpi_parse_cfmws, + &fake_pxm); } - last_real_pxm =3D fake_pxm; - fake_pxm++; - acpi_table_parse_cedt(ACPI_CEDT_TYPE_CFMWS, acpi_parse_cfmws, - &fake_pxm); =20 if (cnt < 0) return cnt; diff --git a/include/acpi/acpi_numa.h b/include/acpi/acpi_numa.h index 99b960bd473c..2435f60e56ce 100644 --- a/include/acpi/acpi_numa.h +++ b/include/acpi/acpi_numa.h @@ -21,6 +21,7 @@ extern int fix_pxm_node_maps(int max_nid); =20 extern void bad_srat(void); extern int srat_disabled(void); +extern void disable_cfmws(void); =20 #else /* CONFIG_ACPI_NUMA */ static inline int fix_pxm_node_maps(int max_nid) @@ -30,6 +31,11 @@ static inline int fix_pxm_node_maps(int max_nid) static inline void disable_srat(void) { } + +static inline void disable_cfmws(void) +{ +} + static inline int pxm_to_node(int pxm) { return 0; --=20 2.43.0