From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CWXP265CU010.outbound.protection.outlook.com (mail-ukwestazon11022130.outbound.protection.outlook.com [52.101.101.130]) (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 14FC517555 for ; Wed, 25 Mar 2026 00:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.101.130 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774397529; cv=fail; b=AdgoVIb5VH/S/V42SaVi5WE96du9DuMmLD+NnqJUKjpMrbbEM+BPjkuhfLRVnrcpf1S9Wrr5z0HVWvBOFHnDXHbXZY9glXfRmdzlYz6K1VnmdY4lXKhbN86aa/uv2c0Y6oKTUVrtAeMpBXy2HeiCulPzovTiI9AVBo/VzvQ2WMY= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774397529; c=relaxed/simple; bh=zuSXnd2SIMoBU0KcCLQrwU0WIu/Rz5UUH5i3JSiNsn0=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=kIrq3gE7LMbJqB8/FZo6OkEOOQTOTydOoy5Ms5cKg6/MSP426JlXzcBEQE9z9RlWdyliNwLvxNsoQNaUmzRLdG/XQsyDOWUULmS/+QYWg2K/Y/3mxUbPtC2bhmRGFNBDklsIR1jqWcsEIiZ311oU6lBeeQb5ryCbRLQO90biZtc= 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.101.130 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=AOFxoym83QLlfbUQ/AczNnA7/gSRfn4LURDerVw/l7WKwtJuC0jZNn2FPUknoVHNE4MNb4ptjFX2HJViN07NDjjqeipbFW1wcvinIsJQMm2a/eYysoPLX/fl7rjxhdcd0siAKYkwYznMwqUHLCgdmv9QyL3iDhPDXPpMgeE6II445w81XzLCByAhervC+7tliMfmeu0bg2Y8JPugEEjakmmE46NOmhGyYs4rfSEJt/9ygg5Nlyvk5WA9Am0G3tzRyJb/SzBy9Q0C8ntPXWA5YTtKlm6XK5iF7bur1FKvJ16Pm5KvTsa5s888f/T4lbh30O0d2AzKVApnwfz0bkJyPA== 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=zW1hZAVr+1MpXDpHMjoawtB0qbs2JdX2Ykvak/KawBA=; b=H6Y/7fptML7HqERiuTBteEMt0nGO/nTPG8TFXA80zh57ltjfRD7DTsNo7cZS5hicsDuXb3WYrwSzrvZZeF9LDzB8Ib5fHoY7ZTNMfvSDnAsl2GijnP9r1WC6jfs9l1+F9rzagmvhVQccFsJwgTOdV5Fq1UlbwZTuhjY7r0zmE2rOwr1SgjQ/oQaQIXC5dQZH04cZtT5kYcdmUHsDN0E7f8UsQXeLNY/Fl3wLNyV3B0ogJ2NtyKSK4iFpvzH1Wbc9eFuRPrvgmVkZQnoe3dI67qhB1vEKnFjVI5WjBP1GqfXcR2eFTCtoasaNkwGoY3rQ+DPny8uwG7GLH6y1BsGf0w== 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:04 +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:04 +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 0/2] fs/resctrl: Add "*" shorthand to set io_alloc CBM for all domains Date: Tue, 24 Mar 2026 20:11:57 -0400 Message-ID: <20260325001159.447075-1-atomlin@atomlin.com> X-Mailer: git-send-email 2.51.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BLAPR03CA0151.namprd03.prod.outlook.com (2603:10b6:208:32f::15) 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: 2b004b11-a50e-4d1e-b2ba-08de8a0324cd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|366016|56012099003|18002099003; X-Microsoft-Antispam-Message-Info: aMhhoLho/cwVh6k5SEcGKikt07pe4SoS1vQZdLeh1puvo3auzX/Ph8aFj+Wak442B3FWatJbN1hGKgE+CguxlKYVjY345v0AZpyikKFFdnpjm42pw/n74i9mSa1BtZEoMTw8YHz/DXEo93vdrNmuxmiiZYqeYm/QuS51gXtYZiOaDvdXHk2/InYBRVW/BD2nCZkGMgY8OLvBLxtq9vYEY86rRrRgLxAZS8erc4JoMD71cElu/V7yWc87/8hnNUuweBysgwYlYPxbvPHAnrRfU0kYcbC1wK+c0SMbJapKDsxKeFz9znTugoDXSYcUrfV2RfpKowzsJ9MDsIa9Qj3OgKlYFBn9719W2cihsfniilcOc4Dv3gE35EkTDcVJAOJImg0m4Knr4F1nvioBHyZwuw/Lcf3qViXY+Afoc+kc43tvHZ6fWipO7obBn6C4bPwA+nC3p+ToCYc2Al8vlGO4ShGszGUVWY3EYebl3cskRJ7fp4xbxhr10C10If2Te3pfqHCIuMTcUCGeL3D/solh+DcpJZKo31abTjKYVE9zxaCroz1aoocGR32kZMswhTkm8LWrLcv4xcL0mHcueU8A80aVArZGUK/3ZWxUnzqeQlwtxYkFuwP4sA/k4ueU1ch4775md14JpfEzJejCdp6GXwKQpI9mIVjiDLztqngdelXcFxgl93u3WZaYr9WmYcKyOxtKiRd42SLaSX9bg2d+isQWNWy8xzCBrWdroUoHEPk= 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);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?wwpysEgCcoDFEJxw8jAVVZXlooDf5h/LvFfocxSOtKtmc3Ssdc+IevmthP0R?= =?us-ascii?Q?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01KHaD1K2ZErv/0N3V/y?= =?us-ascii?Q?8Rw8cDE601ax+/fP8T9yu/bgbc9pCm9i51DPS6a19Emx2S7zlm8M4VbdI5Kb?= =?us-ascii?Q?FS8rM28iQImeSyW/JXzQ8BD3NQNXLYwTsQw1ZcgAocLFfgp1ISHBJ59SB1VN?= =?us-ascii?Q?AqTuiTT8TixEXWpWsCtMQlg21jrJytd4+N4ahUQs0luE2W8W4mMNbwBQEE3z?= =?us-ascii?Q?hAGNj3+Il95cPtIBmT2WoLv/qbi2UL/V2mGmL0yN4aP5Ei3YhpNf1PaOgvuA?= =?us-ascii?Q?Whg3dPCBoXnvqcrfBy2HcCMeubLMZvUO8VL7R48CHIkPc7FBEKTu8fSi9APT?= =?us-ascii?Q?in9GFxYUU4c98lDuf+KL3pYUo84K0SUGoWWjc19IHuWMooD1KiIV/lDeTSEn?= =?us-ascii?Q?8qoTyV+HlDub9tW1F0kmpa6GNT1hr4eukNAgFaEdioRHv/7zqEKpDuik/Aki?= =?us-ascii?Q?nwhVyF6w0K1KmxgGuZZ6i/lvUkjQUIW/qZUNdFRTt40WvXSqgkf/8oFGJ/kB?= =?us-ascii?Q?WzlgOLd9pW2kjewITHZb8A5BH6eRWPc8KrORyuFDBl2Ym805yecewOIBX+HP?= =?us-ascii?Q?Z6FxZqYgE+KhhWik25mjA7fw89K/vEfunFcBCJ9aEI3rU70KuGgALjzK1Jlv?= =?us-ascii?Q?mFqsHlLogPgnK8/mv6HnDU2iO0zGHAphH+2D+fkbzMBkQ3a/tfUwMLHG2sUq?= =?us-ascii?Q?QEjlXfuke8TpFeschOdES/84PJC8+EBBgEmz2RAe56cfNIvPdcN78OXBz3yi?= =?us-ascii?Q?EDDqKKE1WA1Gz30IItvIWSLIKVbNSSe3Iovb4zTFmB9HHjdcvnyS/dbNIQPR?= =?us-ascii?Q?NzoFABUkXw=3D=3D?= X-OriginatorOrg: atomlin.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b004b11-a50e-4d1e-b2ba-08de8a0324cd 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:04.2461 (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: jN7hhpp/flTOh5rBxYf9LrJc+OSY0KTsLadZr90nh+koYzgjOhtwaD4ESKLw7DS6R07aXVUdUonvvA/hOo6oqA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO2P123MB4078 Hi Babu, Tony, Reinette, This series addresses two limitations in the fs/resctrl io_alloc interface: inconsistent error reporting and the lack of a mechanism for bulk configuration. The last_cmd_status file is intended to report details about the most recent resctrl filesystem operation, specifically to aid in diagnosing failures. However, when parsing io_alloc_cbm, if a user provides a domain ID that does not exist in the resource, the operation fails with -EINVAL without updating last_cmd_status. This results in inconsistent behaviour where the system call returns an error, but last_cmd_status misleadingly reports "ok", leaving the user unaware that the failure was caused by an invalid domain ID. Patch 1 addresses this by writing an error message to last_cmd_status when the target domain ID cannot be found. 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. Patch 2 introduces 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. Please let me know your thoughts. Changes since v5 [1]: - Corrected the subject line in Patch 1 to accurately reference "io_alloc_cbm" instead of "io_alloc" (Reinette Chatre) - Refined both commit messages for strict accuracy and conciseness, including correcting the description of last_cmd_status behaviour and removing redundant examples (Reinette Chatre) - Reordered commit tags in Patch 1 to place the Fixes: tag at the top in accordance with maintainer guidelines (Reinette Chatre) - Updated the wildcard documentation to include a caveat regarding systems that do not require consecutive bits (Reinette Chatre) - Initialised parsing variables (dom_id, update_all) at declaration to eliminate uninitialised state flows (Reinette Chatre) - Added robust validation to immediately reject any configurations trailing a global wildcard (e.g., "*=f;1=f") (Reinette Chatre) Changes since v4 [2]: - Split the submission into a two-patch series to separate the fix from the new feature (Reinette Chatre) - Refactored resctrl_io_alloc_parse_line() to prioritise the dom check before string comparison, preventing potential NULL pointer dereference (Reinette Chatre) - Restructured commit messages to strictly follow the "Context, Problem, Solution" format (Reinette Chatre) - Updated the documentation to include the result of the modification (Babu Moger) - Updated the commit description to avoid implying that '0' is a universal minimum CBM (Reinette Chatre) Changes since v3 [3]: - Updated the wildcard documentation text to be clearer and less prescriptive (Reinette Chatre) - Reverted the while loop refactoring in resctrl_io_alloc_parse_line() to restore the standard parsing pattern and prevent invalid domain ID regressions (Reinette Chatre) - Added explicit validation to ensure the wildcard selector is followed by a value assignment (Reinette Chatre) - Restored memcpy() usage for configuration copying to minimise unrelated diff noise Changes since v2 [4]: - Dropped return -EINVAL for a missing seq_show implementation (Reinette Chatre) - Dropped helpers to check io_alloc support and enabled state (Reinette Chatre) - Removed additional complexity (Babu Moger) - Introduced the "*" wildcard for io_alloc_cbm to allow updating all cache domains (Reinette Chatre) - Replaced goto-based line parsing with a while loop to support multi-domain and wildcard iterations - Replaced memcpy() with direct structure assignment Changes since v1 [5]: - Updated each helper for consistency (Babu Moger) - Refactored the loop logic in function resctrl_io_alloc_parse_line() to improve readability - Added inline keyword to each helper - Added inline keyword to function parse_domain_cbm() [1]: https://lore.kernel.org/lkml/20260210210717.3866344-1-atomlin@atomlin.com/ [2]: https://lore.kernel.org/lkml/20260125171752.3374930-1-atomlin@atomlin.com/ [3]: https://lore.kernel.org/lkml/20251231023549.2390630-1-atomlin@atomlin.com/ [4]: https://lore.kernel.org/lkml/20251215230257.1798865-1-atomlin@atomlin.com/ [5]: https://lore.kernel.org/lkml/20251126171653.1004321-1-atomlin@atomlin.com/ Aaron Tomlin (2): fs/resctrl: Report invalid domain ID when parsing io_alloc_cbm fs/resctrl: Add "*" shorthand to set io_alloc CBM for all domains Documentation/filesystems/resctrl.rst | 8 ++++++++ fs/resctrl/ctrlmondata.c | 22 ++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) -- 2.51.0