From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71B1C606A335 for ; Thu, 3 Dec 2026 20:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=qcV1TsYD; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=zfONoZ4S DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To: Subject:Date:Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=mqtDB5BUiwz79uQ25DcQfAVklaxN7dlXh/XpElu2qIw=; b=qcV1TsYDzEL6QA4mGScPH7hKt6 2ITvREyxWAt3/O32WNYI+huGFZtfdY4uhsNWqxu7NmtwvoKSsCPSC761VKcS6Ms4S2/Y5UyorrDDm e5Afyqskf6uSUU6Z5+a7vPdj5s8jrjOFmJn8SMVLc2DRO/XdXykTV1TLtT2K4e77SjSgLR3Z5YZqC SJF0c8QwpKn0T4BBb4VYUgpGp4IwBQt3yBQXWlsYwWoI9mSbPomj4Fl1tbJKe73xKvcPycGLQU9/v xWr+kW+3kOZJ6WQ5HvovZn0lksSXbEWj9oWcRIIn4XJj1QZvzNjFcHSNtBJu582TBEoH+SHRboS58 6ZD6DcjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZCkN-0000000Fr1z-1MN8; Thu, 03 Dec 2026 19:45:39 +0000 Received: from mail-westusazlp170100005.outbound.protection.outlook.com ([2a01:111:f403:c001::5] helo=BYAPR05CU005.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZCkF-0000000Fqzj-3c8O for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2026 19:45:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d2QB8v5uthNloeGWbvXbUz1zZ7xjsLQkRb2xPRXxp729YCGtY8RHkuF6WXjRsmvGQqqLneTChUUBthQOeZbfnIi44sCuxVjWtgD21kYOfJ6kOPVRx3xZ2VUgkjN2n3prLunbAkCutfszzyKXit9ziyzap7UXkLcNv0sb8aU7KmZa+OL/dbTApVwXu2AHjhG9N4xkzfNGJhn/SifG3YMMaPVFyA8p7V13Vetrzx91LXE1goKocgnHtGnjSChrzmczWu7Hggfyzgj/pvfIbUmL6SGpCBgPNGygkd6w8CtU6UqJ2BCTYADxrqncOxX+3b+FoBf9n+Hly48y8F+/c5SUBA== 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=mqtDB5BUiwz79uQ25DcQfAVklaxN7dlXh/XpElu2qIw=; b=yBe2Mh4zHHY5vQ+icfHab4Mp3C+u+O5S32Pbilc3YheRoYQUdeUCWUewp/cr2PqN7I7dZDdUglLX3WJqsHQzxl3CPo23LUueRXb7sgRcPtL8dQIoQwFC805zZuEy1HxRGadOgShpw6e5aIUcwdTk5SMzyURSFkb75OY+U9jT4z7rlJotMPSD7ZF9DvBxwWbU1xMSYBH2Jf2tnx0hdxz0cGcQ3qraaIQBXr1ik3j4P5nBoIp3E62TYRa6wmdY8tPcHhe21oG1U3X7KGMpM5+xdfIMu7sPaYdfRFpcVuzjJespIof6Ry9/OqSjqTBdmdOtZj1ODcsUOomr1lrEBEM4YQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mqtDB5BUiwz79uQ25DcQfAVklaxN7dlXh/XpElu2qIw=; b=zfONoZ4Ss8ScL1swtVH2aSbkeHL8AcuOxJc6NYtprLPx+2aKeSPOcZos4PLvKnESp/XtpzroPMtG/7F33H7dXseo2867RvlounG4Tsj7H20U90iNTX1/Z1HTTS0sjfv1Ge9eLptZmMIsVXhbobzAZikHH3ISUPsYigPVNcBe/jI= Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5320.namprd12.prod.outlook.com (2603:10b6:208:314::17) by CY8PR12MB8244.namprd12.prod.outlook.com (2603:10b6:930:72::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.12; Thu, 3 Dec 2026 19:45:23 +0000 Received: from BL1PR12MB5320.namprd12.prod.outlook.com ([fe80::1876:4a6d:2cf5:b8d1]) by BL1PR12MB5320.namprd12.prod.outlook.com ([fe80::1876:4a6d:2cf5:b8d1%5]) with mapi id 15.21.0688.011; Thu, 3 Dec 2026 19:45:23 +0000 Message-ID: Date: Thu, 3 Dec 2026 13:45:19 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 04/19] fs/resctrl: Introduce kernel mode enum To: Reinette Chatre , tony.luck@intel.com, ben.horgan@arm.com, Dave.Martin@arm.com, james.morse@arm.com, bp@alien8.de Cc: corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, x86@kernel.org, fustini@kernel.org, tglx@kernel.org, mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, fenghuay@nvidia.com, rppt@kernel.org, arnd@arndb.de, kmehltretter@gmail.com, dapeng1.mi@linux.intel.com, elver@google.com, enelsonmoore@gmail.com, jlayton@kernel.org, seanjc@google.com, ewanhai-oc@zhaoxin.com, binbin.wu@linux.intel.com, nikunj@amd.com, ashish.kalra@amd.com, peterz@infradead.org, superm1@kernel.org, thomas.lendacky@amd.com, prathyushi.nangia@amd.com, kim.phillips@amd.com, ricardo.neri-calderon@linux.intel.com, darwi@linutronix.de, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <585ca5c1-9edf-4c5c-ac44-864d51ac2acb@intel.com> Content-Language: en-US From: Babu Moger In-Reply-To: <585ca5c1-9edf-4c5c-ac44-864d51ac2acb@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH0PR07CA0007.namprd07.prod.outlook.com (2603:10b6:610:32::12) To BL1PR12MB5320.namprd12.prod.outlook.com (2603:10b6:208:314::17) X-Archived-By: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5320:EE_|CY8PR12MB8244:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e06faa3-45aa-4b41-7d3b-08df5175f879 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|366016|1800799024|376014|23010399003|261022105027099003|11063799006|10067099003|56012099006|261021121427099003|261009223027099003|261022075727099003|261102123227099003|261028144727099003|261026140227099003|18002099003|22082099003|4143699003; X-Microsoft-Antispam-Message-Info: giPlgv0RPzyW/BhCx1tNFLRf5XrDmfkqKeGlCWUEidTPcgzP0LnHxmv4z71g0MvGJ+4eW2QBlE7P2OtAH26ixlY8smalv531xJZp0bCbGjfzYrVdLorj7U+sguadYw4fYAhZ4VPKxyJNC+0/sHn+L+qelyzE9Zb1jbGeOySIamsFxgNOMQ2sI+rm7ipLaADhmcm41hA54e30QyjtNlL26q8jFC68TGj6eWV2Pt8fcGWp65F8zRMHqy239CIeQnpbTKoOg3824IJeete+DZVI3a99R3r99TDzEx//ZfpHnQBaMlQkdzDzMD0iJKBJoDVFQwe8mlv3Upock75oYP+DU+QDvcmyoHftWFPRLo+3IJaacERfMlD6UgMZDsRpNGQzk9LeL/3j3HLUFpv7VmFT0ZYZq2/WcrOgYZdiyC9dY+y90TgsBy7jabq4hMEQL5MpCqpjCsbuEEwp1GrItoQIoG33ZAWrGrP4FmA0Dz2Hbvm7TazVa8QkUulwVu3OSCEV5OdVFA15Rm/7BYsFvQKh0zHp5NUQ3wluhKXaVDsJYsHvq5LQVNC8SVo2O9emudsilXjL/FcvYAbPyRPtpJUlygfO6/F3p1ZY8pZ715NMgILvI0i7Hn9jNeBOEu+YKSuJuteVC3O5lqqaK6YtGAIysvCd30g+dIA7Zgj2jDmblM0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5320.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(366016)(1800799024)(376014)(23010399003)(261022105027099003)(11063799006)(10067099003)(56012099006)(261021121427099003)(261009223027099003)(261022075727099003)(261102123227099003)(261028144727099003)(261026140227099003)(18002099003)(22082099003)(4143699003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VUIxV2hic2FvK1REakFHelQ1R0ZZaXdjMzEyYllvY1NpTUhkbEdsQkhPTG9z?= =?utf-8?B?ZFBtUm41V3c2SzJ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HY4?= =?utf-8?B?V0k4enNJeEUvVVV5K2hOc2tSRysvaWYzM0VNMFIwREthd29oRUNOV2tkb1Bz?= =?utf-8?B?bkVIbkUzaE5uOUxoODJndU5PVVlpN2ZaWWtiUHhEWUgra3VOcUc0TENUMHVB?= =?utf-8?B?R2Y1cVN0dnZLdkNtVDd1Y21sS0hEUkxycTVHQ2NJMEY0OGhFZGxUS2RLcndp?= =?utf-8?B?V3Q0SG1oNkR1bitoRmJTUW9vV1NkbUpGaWtkMExNVWVpZDdXQldoZlQxZjRv?= =?utf-8?B?eHVnaVc3dFgrMEhTZUdLQ0FoUHJuYm4raVJCNUVJY1R4MHVVK0NTelEyZWdj?= =?utf-8?B?Y2ZBbHVkRUx3amgrZ0hCb1YwWHkvVFlqTEVnaTZMaW50WGlKckdhVExGaksx?= =?utf-8?B?WVZiOExSbUx0L3R5YkxZTXRza3ZDRWxHLzVkQlJiSHM3elBSQi9pRVNvUUxV?= =?utf-8?Q?I2E5jDlwY37YFl5iQY?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e06faa3-45aa-4b41-7d3b-08df5175f879 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5320.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 19:45:23.3742 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8wUxGu9sSln+Y9Xjd6Rivjk3MQdcfJacoslM/biBupu+APlkv5pvcmH5gw/KyxXc X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8244 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261203_114535_755434_1E61A88D X-CRM114-Status: GOOD ( 28.57 ) X-Spam-Score: -2.3 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Hi Reinette, On 12/1/26 22:44, Reinette Chatre wrote: > Hi Babu, > > On 11/11/26 2:43 PM, Babu Moger wrote: >> Kernel work need not use the CLOSID and RMID of the user task on whose >> behalf it runs. On x86, Privilege Level Zero Association (PLZA) enables a >> CPU to use a different CLOSID and/or RMID association while executing at > > Please drop "association". Yes. > >> privilege level zero. >> >> Resctrl needs common definitions of how kernel work is managed so that >> architectures can advertise the kernel modes they support and user space >> can query them and select the one to use. >> >> Introduce enum resctrl_kernel_mode: > > This is missing a motivation for why the modes below are introduced. How about > something like: > > Introduce enum resctrl_kernel_mode with the behavior of every system today > and the behavior that PLZA supports: > > - RESCTRL_INHERIT_USER: Kernel work uses the CLOSID and RMID of the user > task. This is the only behavior available today and remains the default. > Naming it allows it to be reported and selected again after another mode > was in use. > > - RESCTRL_GLOBAL_ENABLE_PER_CPU: All the kernel work uses the CLOSID > and/or RMID of a single resource group, which may also have user tasks > assigned to it. The mode can be enabled or disabled per-CPU; on a CPU > where it is disabled, kernel work inherits the user task's CLOSID and > RMID. This is the behavior PLZA supports, but the mode is named for the > behavior so that any architecture that supports it can use it. Looks good. Thanks. > >> >> - RESCTRL_INHERIT_USER: Kernel work uses the CLOSID and RMID of the user >> task. >> >> - RESCTRL_GLOBAL_ENABLE_PER_CPU: All the kernel work uses the CLOSID >> and/or RMID of a single resource group, which may also have user tasks >> assigned to it. The mode can be enabled or disabled per-CPU; on a CPU >> where it is disabled, kernel work inherits the user task's CLOSID and >> RMID. >> >> Signed-off-by: Babu Moger >> --- > > ... > >> --- >> include/linux/resctrl.h | 25 +++++++++++++++++++++++++ >> 1 file changed, 25 insertions(+) >> >> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h >> index b6b4519a5190..6f3e57ec4aa3 100644 >> --- a/include/linux/resctrl.h >> +++ b/include/linux/resctrl.h >> @@ -716,6 +716,31 @@ int resctrl_arch_io_alloc_enable(struct rdt_resource *r, bool enable); >> */ >> bool resctrl_arch_get_io_alloc_enabled(struct rdt_resource *r); >> >> +/** >> + * enum resctrl_kernel_mode - Kernel modes >> + * >> + * @RESCTRL_INHERIT_USER: >> + * Kernel work inherits the CLOSID and RMID of the user task. >> + * >> + * @RESCTRL_GLOBAL_ENABLE_PER_CPU: >> + * All kernel work uses the CLOSID and/or RMID of a single resource >> + * group, which may also have user tasks assigned to it. The mode can >> + * be enabled/disabled per-CPU, all online CPUs are enabled by default. >> + * When the mode is disabled on a CPU then the kernel work on that CPU >> + * inherits the CLOSID and RMID from the user task, effectively the >> + * kernel mode becomes RESCTRL_INHERIT_USER on that CPU. >> + * >> + * On x86, CLOSID and RMID are configured independently; either or both >> + * may differ from the user task. > > I saw the comment from sashiko. Considering this is an x86 specific comment in > resctrl fs header the above sentence could also just be dropped? Sure. Dropped it. Thanks Babu