From nobody Thu Apr 2 17:23:06 2026 Received: from CWXP265CU009.outbound.protection.outlook.com (mail-ukwestazon11021122.outbound.protection.outlook.com [52.101.100.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3868C3597B for ; Wed, 25 Mar 2026 00:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.100.122 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774397537; cv=fail; b=Iorhn8zsY+Q57kSsExeSNbpaBNK9b3sAvowRpHL/JtzLzB27HvUjCUjkTMQ/bbylSpPNK4dfm9z6/x61noMmGyOh4o035T12186B/25H302dy2aQIXte1RSwlrtV+xHer9QStdgDJGpNm4ZUZBHQWm9u1Dd+i97oUW8gNbAm9Mk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774397537; c=relaxed/simple; bh=Ed7FpTywNYmqVECFcBlSjwQKxjFCKFXNX+XE+SlElrU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=OGMRa2KKA+eKQVr88j2mbpYlZHYQM0An60hyYmu68LAC6O2Ujp56Uc5Wt4EuGQs12Hz+iheLO6imT9oxjFHeWmrPbUU49fmEm/ZbxdS9kQFKppG61Ph/I1LxTP0U1WchBA7oiE7pB7qpdfJn/f3NQWo1TBVRlmLrGDdPN5Fgc7M= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com; spf=pass smtp.mailfrom=atomlin.com; arc=fail smtp.client-ip=52.101.100.122 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=atomlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=atomlin.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MJuEVty1DzseonbcxPOPj2sWvTy9V1FsLS9IqrN41j3psgfnSRuBZH5ygky/YeHXBs0wwddEZSWBKWLmxFQkBYmtFPTubfV99KodQAFGR1kZmLzCFIvM/7x1l8XFmPw9NhukgGU9nfJnAU5FrNS/4Q2dFpQNjqigpGyhOnZjy+ewtZmVqff/VHOHtpBLe0zZJaQgKhG1sPF8bh/2I/wjZPRFMw9T6AbufCB5HcA0ITpq3qDh05zpWEOmZhFEuf/ykYWL7kSO45VNK/QhIGaSCB0wwUctvPaEB5rLUGAzhlWZmtr9uB3l4u5L+Xswt/FU35KxFOHrDaWiRTQ2bkB3pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=35VImnqpMbG2j5x2ZkvJDqUwUaIs/uZ16T/eCoa1Tvw=; b=KxNxfyux3kVBpeoJLEW97734HZnVjg0NgXX64M9iUaWxe3KUdmtGU79c/Fm508zJkcCkYj47omaPtgueKSX30AbyIx2E6Tw1iGKM/Ir9Z9IROcux7R/GLNsFOwe7DfBzMAO36F1m847J5CqnFIxrRTcH/d2hQ6B++sK/5ZL6oAB5hOAnfS5lQDS3kQn11iQ0lTnySc//REQ7tSTQuQXSFbeAUeLfE41pwZHofr0PEVYmFuEE01UqGztlVhLGv9bzjkx0NSipeAjqHdcB/zfA+t6P0gXCqhf9KJ0fRiXC4gIqx9D6T3ILMXKAwx+Umnho2UAsXzprX38db+d6WSWWVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=atomlin.com; dmarc=pass action=none header.from=atomlin.com; dkim=pass header.d=atomlin.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=atomlin.com; Received: from CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:70::10) by LO2P123MB4078.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:160::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9723.31; Wed, 25 Mar 2026 00:12:14 +0000 Received: from CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM ([fe80::de8e:2e4f:6c6:f3bf]) by CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM ([fe80::de8e:2e4f:6c6:f3bf%2]) with mapi id 15.20.9745.019; Wed, 25 Mar 2026 00:12:14 +0000 From: Aaron Tomlin To: tony.luck@intel.com, reinette.chatre@intel.com, Dave.Martin@arm.com, james.morse@arm.com, babu.moger@amd.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: dave.martin@arm.com, sean@ashe.io, neelx@suse.com, mproche@gmail.com, chjohnst@gmail.com, linux-kernel@vger.kernel.org Subject: [PATCH v6 2/2] fs/resctrl: Add "*" shorthand to set io_alloc CBM for all domains Date: Tue, 24 Mar 2026 20:11:59 -0400 Message-ID: <20260325001159.447075-3-atomlin@atomlin.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260325001159.447075-1-atomlin@atomlin.com> References: <20260325001159.447075-1-atomlin@atomlin.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: MN0P222CA0006.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:531::9) To CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:70::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CWLP123MB3523:EE_|LO2P123MB4078:EE_ X-MS-Office365-Filtering-Correlation-Id: f6c263f8-cf7f-4d54-dcd3-08de8a032aa2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016|56012099003|18002099003|22082099003; X-Microsoft-Antispam-Message-Info: cWc7LpZKUiapfn9ua3fnMMcCB5mDB5+0jg8o9VhM4Bktr+rhBHbhTp48oxkMHRK1saqvK0FhowEfr3qVMe4LJlvV95REvk2U2R3MPF834EMCTAxOopoxZ8xTPFkWc/r/IXaw1bxbzWJAXOnFmCu5NHRrg5k+VY/HqeNPlbBJOomfwA9apoU9/lhem3js4SVyZSKJPCuYjksbTKtHXCwj0aAV2Pfzjqa6v1pjQ1l7I4eoFxslepfbrJNzyJ27eCr88kR7lScfKAAswVmXqN582dpbolNwxQZf0z9f/N76kqdPh8ezsx5T2kWd2XKEW0PPsA5Fw5cCBLDOlwIb/m2ktCtfmNYZS3GFsbmr8XYbLOvJ1rM6uOQGvOh0dndQjN2Bf1vIq+zmIKLgf/B7BWTvn+HxO6c/I1nC/W5FOatIBatYB4Qte73NnL4/e3IAuYFcGV6UuqqNd8CgnZBIDJh8yyD8hiyxID2wo82RCuP2l7pR/Q3TJ6c8ghdVyQCrRxyI6vxSwAobLhdV1Bb2vs5HUkTfc/neIH1/VU5ztIKNBJMRcneT4UPxgFtgF3sdMR2/CDgAwUVvTLbLtQJkShPuJ8Nb4R4wcRdkftD78x2pSDdmbtFA2Mqb7o6FaVJ2D2GfWC0QMpwtDmRJfCgBOQKasKeqxIHFUnKUUTTR70i1VC0D0rMM2Ilp0SyCzDw4zd7Nl0ZQTIxOVuG5AicOLy7470iitmZtnmEIwq47rOqFGpE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(376014)(366016)(56012099003)(18002099003)(22082099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-Anti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7e4xmmQB/2/Da1rexVPa5cKyPTPfm2E73rZd04ENu1TBoWoxi?= =?us-ascii?Q?WIfjAWM0PCRAtwXbNzrmOX+WubBEiUKUutejdYqioh6ioszyMd8mscJQyfvq?= =?us-ascii?Q?8tf5TwLSntGVa27VyCMGgjdnToAWBFD6evFVAQbQMGmnzWk9e5j7ybQogXMD?= =?us-ascii?Q?KNptESc5tcUd7JiV+hdIJYZUvOt50EijJEEB85Sy8Z2vqoy4jFhntImDcMW7?= =?us-ascii?Q?sb5sPdKNbNVYlvO5uDOyOG6dIlVTJdbNBWzl8yMTwIHlN8ILTohizWq3jOFi?= =?us-ascii?Q?QdkuYuJBKQLP/dTfLFssr585decc8nZZdbLWQdQx8dBeUUTl/uInBW8U+gmS?= =?us-ascii?Q?b3xy3GGMQlzFOCVn2gRm4zuTVZvdgtcY/ySBnXOwzZzCZaPBlJynOVSvra+3?= =?us-ascii?Q?7CtENc6wjhhx9jLgLQkpsKG/sZLDL2jBvNe70XCYOljzJonORQPOCBT+up2U?= =?us-ascii?Q?mzzNIK/dq0eYAngT9krUjpbkK5Jc2F8h0E95zNLEzSHqqT0PepWsYMNu5dpj?= =?us-ascii?Q?YyVN63DYii/XaD/lz44deO+YEmAAEsCIg35Q2jK308Ka61VNvtq5yxLgb4KB?= =?us-ascii?Q?c1H3nUPgkFE9Ezxs5iRmHcr+g7qXcWJenyCepJO0U5r7LKt6PtAF4q2C1UVz?= =?us-ascii?Q?kFytjmc6FrIK86V537uHR6vNKMyWmW19csORQeNATzNBeid+FIOlXkTQlptF?= =?us-ascii?Q?w74h37RRUS9AZ/yqbowCjQapSCGvxu2tDyNu5h4u8y8ufjdOgxMm4lZInKgr?= =?us-ascii?Q?j5olyE7aTEHMgFOZovqj53iyiVAGykx/DOy7fcbin2yoSSrf+TS03KZ+1AKr?= =?us-ascii?Q?T/3fB2tT9JMzErTi+J4t40rqEpuUtMgd8TSgmFJ8XZdLPGnyutcV3BjaqsGa?= =?us-ascii?Q?neoq9oWmrg=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6c263f8-cf7f-4d54-dcd3-08de8a032aa2 X-MS-Exchange-CrossTenant-AuthSource: CWLP123MB3523.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2026 00:12:13.9937 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e6a32402-7d7b-4830-9a2b-76945bbbcb57 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vVBoPw1WvEote7XvqXnVfEAq+AtEb+bDdNpKuoUx7GeEPhRr+vFMAhanhRgiOLLFhbbnprDG4txoN5cVn/2y5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO2P123MB4078 Content-Type: text/plain; charset="utf-8" Configuring the io_alloc_cbm interface requires an explicit domain ID for each cache domain. On systems with high core counts and numerous cache clusters, this requirement becomes cumbersome for automation and management tasks that aim to apply a uniform policy. Introduce a wildcard domain ID selector "*" for the io_alloc_cbm interface. This enables users to set the same Capacity Bitmask (CBM) across all cache domains in a single operation. Signed-off-by: Aaron Tomlin Reviewed-by: Reinette Chatre --- Documentation/filesystems/resctrl.rst | 8 ++++++++ fs/resctrl/ctrlmondata.c | 21 +++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesyst= ems/resctrl.rst index ba609f8d4de5..b003bed339fd 100644 --- a/Documentation/filesystems/resctrl.rst +++ b/Documentation/filesystems/resctrl.rst @@ -215,6 +215,14 @@ related to allocation: # cat /sys/fs/resctrl/info/L3/io_alloc_cbm 0=3D00ff;1=3D000f =20 + An ID of "*" configures all domains with the provided CBM. + + Example on a system that does not require a minimum number of consecutiv= e bits in the mask:: + + # echo "*=3D0" > /sys/fs/resctrl/info/L3/io_alloc_cbm + # cat /sys/fs/resctrl/info/L3/io_alloc_cbm + 0=3D0;1=3D0 + When CDP is enabled "io_alloc_cbm" associated with the CDP_DATA and CDP_= CODE resources may reflect the same values. For example, values read from and written to /sys/fs/resctrl/info/L3DATA/io_alloc_cbm may be reflected by diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c index 2ef53161ce11..9a7dfc48cb2e 100644 --- a/fs/resctrl/ctrlmondata.c +++ b/fs/resctrl/ctrlmondata.c @@ -954,25 +954,34 @@ static int resctrl_io_alloc_parse_line(char *line, s= truct rdt_resource *r, struct resctrl_schema *s, u32 closid) { enum resctrl_conf_type peer_type; + unsigned long dom_id =3D ULONG_MAX; struct rdt_parse_data data; struct rdt_ctrl_domain *d; + bool update_all =3D false; char *dom =3D NULL, *id; - unsigned long dom_id; =20 next: if (!line || line[0] =3D=3D '\0') return 0; =20 + if (update_all) { + rdt_last_cmd_puts("Configurations after global '*'\n"); + return -EINVAL; + } + dom =3D strsep(&line, ";"); id =3D strsep(&dom, "=3D"); - if (!dom || kstrtoul(id, 10, &dom_id)) { + + if (dom && !strcmp(id, "*")) { + update_all =3D true; + } else if (!dom || kstrtoul(id, 10, &dom_id)) { rdt_last_cmd_puts("Missing '=3D' or non-numeric domain\n"); return -EINVAL; } =20 dom =3D strim(dom); list_for_each_entry(d, &r->ctrl_domains, hdr.list) { - if (d->hdr.id =3D=3D dom_id) { + if (update_all || d->hdr.id =3D=3D dom_id) { data.buf =3D dom; data.mode =3D RDT_MODE_SHAREABLE; data.closid =3D closid; @@ -988,10 +997,14 @@ static int resctrl_io_alloc_parse_line(char *line, s= truct rdt_resource *r, &d->staged_config[s->conf_type], sizeof(d->staged_config[0])); } - goto next; + if (!update_all) + goto next; } } =20 + if (update_all) + goto next; + rdt_last_cmd_printf("Invalid domain %lu\n", dom_id); return -EINVAL; } --=20 2.51.0