From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.43.66 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795017476; b=FyJx36guEJuZkdyrCtyoD+mdiTdcnqrp91WdBYRphNwKYpVtReynbk/ooa5piPRGAAJd 28HrEPIprCpBYZykky7CE5bJkdTyGWmyuPbE+wKfUfO2BVE3IW0dpRvVviQZJJv34NtAJ py8TFgai785734ecY1cRQp/yOO9C060yRWnJ/5pXvDkWMraaTf/ZzVz9TE78avbuJir0f xgUkzyOmNkX9ebXbWHIOGx8XwPS8XEyWfJB4X/viKvRy8p9JPqgduClCX2eLGE6RFyY/7 zOdkHEtM2lSXsGLf9TJmWx6Fc4ggFo11KZV2gCR4hwreUDbTIXhXEHit4CdQudxrcUA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795017476; h=DMARC-Filter:DKIM-Signature:Received:Received:Message-ID:Date: User-Agent:Subject:To:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-ClientProxiedBy:MIME-Version: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-MailboxType: X-MS-Exchange-CrossTenant-UserPrincipalName: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=TnJdDy+00BKDpm0eCyPFTEXihHtsc8V4Uj+Bp9ffKVo=; b=Cj2tK2DYcZSa9Q9aVxOGcUrUxi0DYqr57XjZdiwmF772CTaWypRP3PfS4PHTBuPjuxyi b++So6suexgRfDLfZreLNSjwvVi/WlQWwvBOYLdzDa+pd2qGE+DY8zGP+98mD/uZRyqjo 3TIc9g2nwxglPkFFFE3SikVI5qEmvGJ5taqCR5S9c0ODcba2RrTbJObelFOsnqfjRi60u 1WF0x/7f2WXAMOMQ9FyJnAxTLOgk8uugsBnbQd1rf3bWqJ0gNGW0CubN0rI7vvbX8EzYg fIEJkKdSP83cYgFcI2hqECBXZX5ZHxLO7RwFQIRlw6fO+RnA5Wvgs8nEFnT6gonsocQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b="D/p3z+/w"; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.43.66 Received: from SJ2PR03CU001.outbound.protection.outlook.com (mail-westusazon11012066.outbound.protection.outlook.com [52.101.43.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71FD8606A320 for ; Wed, 18 Nov 2026 15:57:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 71FD8606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=D/p3z+/w ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KrDM5Gu4qI10c9OxgQ0XhAagnfrfNm7UjdQ2aKFxe2oXuVBx1l5ijryZRTnBfViIQPuFTzgxht1u/UhbSfyopg9WclVsmdBNWQwmdpqFs9XXgCco4R730TO8dtgKyAY3etYzPIy5DIUYOEpX+IJgv24xsx3H/77he/UuxSfq1BZyxP9UOA5uP1W7++vJ9lA0JMN7JG9o6ph/27kcFJ3NYdfGq/6dmKkn4OWgt/UQrsmUc3WBRp+1vSIcoNkeSYAbrprozoqECiibP+YuPs2uvBVK1XX+8cbj7R8EwVdOXvkGnnPQoOgO+5LO5PBwaFvlfdiYz3vgct2A9SKavwAkRg== 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=TnJdDy+00BKDpm0eCyPFTEXihHtsc8V4Uj+Bp9ffKVo=; b=eZ4zWEPotZUcZAU/FEMkWikv64yQAxql+jRhYNu4iVmh5Jup0MJJROcAE7mxPhkS95z02AqF/BTUflR7cOIo9WhBkwd6NU+uvGPpPGe1GaXvQJq9QNNwahQVu/tqyrtCbiVoSdpmLw8UXuA7r4WxJnjJBM4Vu/prJl58JK//PUma2Yde9mT2KSb5aUcVKmnvdyuchJB3XRimqHkM9OJ5oP8Pch+bffvJOq/ns02gZ6zjUue7BIWSrOsRu5LjGHy6OuRn0PyUYO00wxuIKY78T9prKF7ObYiZ14KP/DG17YIG3vdFyaxpA8sqQfY+45UTTSKJ4UwxN8kRRWtS1rEoHg== 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=TnJdDy+00BKDpm0eCyPFTEXihHtsc8V4Uj+Bp9ffKVo=; b=D/p3z+/wvEzwekyh6aPacMOlKFITtY8o/l41E9MGc3zdxwuOMIZpu/JXGfyg7o2XR33ht3Z2//bZKM9PNqluHl1tH8KCS3f46bAZzq0Rjmg6yH6goJ5IpZ7iE+OvCzToXDODnqVfyGS3Z4oPbwHUghOUx1MCGFFaGcDOo2jaWYw= 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 CH4PR12MB635819.namprd12.prod.outlook.com (2603:10b6:610:509::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.615.14; Wed, 18 Nov 2026 15:57:52 +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.0615.013; Wed, 18 Nov 2026 15:57:52 +0000 Message-ID: <0e3716c3-c537-4f5c-a6a9-3272908b8e86@amd.com> Date: Wed, 18 Nov 2026 09:57:49 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] fs/resctrl: Give a monitor domain the counters the groups already use To: Jinjie Ruan , Ben Horgan , james.morse@arm.com, reinette.chatre@intel.com, fenghuay@nvidia.com, tony.luck@intel.com, Dave.Martin@arm.com, will@kernel.org, jic23@kernel.org, gshan@redhat.com, bp@alien8.de, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20261113083506.4129060-1-ruanjinjie@huawei.com> <20261113083506.4129060-3-ruanjinjie@huawei.com> <10f43d19-2994-4ad2-8a49-2891582e32e7@arm.com> Content-Language: en-US From: Babu Moger In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: CH2PR15CA0022.namprd15.prod.outlook.com (2603:10b6:610:51::32) To BL1PR12MB5320.namprd12.prod.outlook.com (2603:10b6:208:314::17) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5320:EE_|CH4PR12MB635819:EE_ X-MS-Office365-Filtering-Correlation-Id: 95fe7cc6-01d8-4f78-bc33-08df458cb3bf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|23010399003|366016|376014|7416014|261022105027099003|261102123227099003|261021121427099003|261026121527099003|261022075727099003|921020|261028144727099003|5023799004|11063799006|261026140227099003|4143699003|56012099006|10067099003|18002099003|22082099003|261009223027099003; X-Microsoft-Antispam-Message-Info: 69qOpg0YSyuG8B+q6dHEym15wpOg7ptuS6EFf7jdaSZXXOzG7QpmXFRJuDmJ4uWb+CxBqh2WJ2UtGd6TQ7v7AX761VchZ+Gqz0JSTyo9uPEPifUcyJtaaQTcDVD6ya/33fSy2e7+MEnqmTjnFvdl60Omgvt5+lFXVkJjhEEY+QYMolxN1npt+j5i+ZsD+/a/ZG0YDknAAk6CNIBtDn/KZ9zKNflfiTZWZgHecc5sPAl63KWPHPbsnzvQ+J1m16u7Jf2a+owTW9ADkTGI6UnrkucnSCoDHQVxsuaK26K9/0d6KZPaDFkl10rZlD3bL/UcEKyOzgdVXcCyZbeMTCrGxc3R/fWLaEFT9gCNgEGkuZoAxUxvfP3cwRQq7fcCgo0tYf6EGZDttOIVF5Jqf8Va+9mBPjCpMRAVVYtfhvxp4bjf0Sydh4VZOHjgeLqoNlOrqvEJlxWkMwcPx2/PzsVHBqX3GmHpzgxUe4pf+BDV/V5u8GyThpAry652mNO7/Q/LnKhEY8tskxX53x9NnNhDxpS3b5urr/Mr5f+gNxQH0ZKKgMLYzGqTK/kD+N/AkNhEZGQIhHRf3bNInAS5jCWIyIVoJJBPannQcd0tdKGVdHCtplaLfN60MiaWN9CbUkmsLUd3i0dCQr6jIdp5G4hOyw== 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)(1800799024)(23010399003)(366016)(376014)(7416014)(261022105027099003)(261102123227099003)(261021121427099003)(261026121527099003)(261022075727099003)(921020)(261028144727099003)(5023799004)(11063799006)(261026140227099003)(4143699003)(56012099006)(10067099003)(18002099003)(22082099003)(261009223027099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dE56dm00T0g3bURJZW5JdVNRVzZuNkhiNXFaeDl1Y21rZmRYY2dDRy9JemxE?= =?utf-8?B?bFBQSHFQTTV2amNOWkhUeVV2RVZoZ2tCT2lFVmtHS0NxQWlnbWRkOUxsRWFr?= =?utf-8?B?Kzg1dE50cWNmaEN4aTNZeklGai83NzZrZFJtUDFZeUI4cno4RDk1d2JoQkJ4?= =?utf-8?B?cHorMjh0Z0ZRU0lWS3J3eHpBVXJBKytoVVlmK29LWFJTTldZaUpacjNOZ1R4?= =?utf-8?B?eTVZUFNIRUJNeDJSMkpPazZoUEUxT2lOZHJQaWNua1YxY2k1Q1ZwZDZrakFU?= =?utf-8?B?NkRUelhzVm1zZk92UCtUZHVOMVV2TTJBaXdXYnZJMExBSjllTVYrM0ZUeVg4?= =?utf-8?B?SDJ4N25DWHBWMnlxMUVETVRWblV6c1RiZGJVaDZ5N3BuM0xOZHFQaTBTdXpQ?= =?utf-8?B?UmVQeXVBbVBpV1UzSktsSHhyOHBjMXpaVitBY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9xSHg2ZzMyV08rYjl5bTAzMStqb0l1aGRvQXVMTWtZdTJweG43R3I0YmJm?= =?utf-8?Q?syHl9RuZGZEUNVwGlA?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95fe7cc6-01d8-4f78-bc33-08df458cb3bf X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5320.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2026 15:57:52.4642 (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: 8rWBSjVABOWhMdhlYsftAJ3vhi10uk5K1u295wkksZJJ7a5iElrxIbG0Gd409IHt X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH4PR12MB635819 Hi Jinjie, On 11/15/26 22:02, Jinjie Ruan wrote: > > > 在 2026/11/14 0:14, Ben Horgan 写道: >> Hi Jinjie, > > Hi Ben, > >> >> On 13/11/2026 08:35, tizi4590 wrote: >>> From: Jinjie Ruan >>> >>> With assignable MBM counters, resctrl can be mounted while all CPUs of >>> a monitor domain go offline and one of them comes back, either through >>> CPU hotplug or because hibernation takes the non-boot CPUs offline. The >>> domain is destroyed and re-created, and the new domain starts with no >>> counters assigned. Counters are otherwise only assigned when a group is >>> created, when rdtgroup_assign_cntrs() takes a free counter in each >>> monitor domain for each MBM event, so no code revisits the groups that >>> already exist. >>> >>> Those groups read "Unassigned" on the new domain, on any system with >>> assignable MBM counters. A counter assigned to them later through >>> mbm_L3_assignments is the lowest free one in that domain, so the same >>> group can end up with a different counter ID on different domains. For >>> example, with the counter ID each group uses for mbm_total_bytes and >>> "_" for none: >>> >>> domain 0 domain 1 >>> mount, mkdir g1 default=0 g1=1 default=0 g1=1 >>> all CPUs of domain 1 offline default=0 g1=1 (destroyed) >>> one CPU of domain 1 online default=0 g1=1 default=_ g1=_ >>> assign g1 on domain 1 default=0 g1=1 default=_ g1=0 >>> >>> Each domain has its own counters, so g1 can use counter 0 on domain 1 >>> and counter 1 on domain 0 without affecting the other domain, but until >>> it is assigned on domain 1 it reads Unassigned there. >> >> I brought this up before and it was assessed that no change was required: >> https://lore.kernel.org/lkml/171f92a3-fa2e-44fb-b0d1-1250c72e31d1@amd.com/ >> >> Do you have any particular reason for wanting this behaviour? > > I discovered this issue during the testing process and feel it is not > very reasonable. > > This patch doesn't assign anything new - it only restores the counter ID > the group already uses on a domain that stayed online. > > So with the patch, Babu's two cases (`2=e;3=e` and `2=_;3=e`) both come > back exactly as they were. The only case it can't know is a group that > used a different ID on the domain that went away, and there it leaves > the event unassigned rather than guessing. I see this patch is trying to address two separate issues: 1. Automatically assigning counters when a domain comes online I understand the motivation here. It is reasonable to expect counters to be assigned when a monitor domain comes online and counters are available. However, monitor domain online/offline events are typically driven by CPU hotplug, hibernation, or other user-initiated actions. In these cases, the user is generally aware of the state transition and can explicitly assign counters after the domain is online if monitoring is required. 2. Retaining the same counter ID across domains I do not see why this is necessary. The design of assignable MBM counters intentionally treats counters as domain-local resources and provides flexibility to maximize counter availability across groups. Counter IDs are an implementation detail and are not visible to users. A group using a different counter ID in another domain does not affect functionality or monitoring results. Therefore, I do not see a strong justification for preserving the same counter ID when a domain is recreated. Given the above, I am not convinced the added complexity is justified. Thanks, Babu