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=192.198.163.5 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796313680; b=bcTbFNP+5SgkotCbvDmScgK6QlmKmoW7IRoIf6QEqV6xV9LiZWfToOXK/IU5DBfBizCe TA8ZAVG4ecCDdNZE9oaP5q4BqNvTmtfJJ6eMfTMeBYUExRtP5ejK8XcnPQXauxSO9K+9n pe0kUSdwJCjpTjsvSZp9JyvxKtnv4gbLNdz86+1KhQTe8f9YJvs31O/vTepu6ftAm+pb9 8Fe4t1reS5T67jDgT8KiphVtx4yWlLHt9xqX2O9hk37ID3Cxe67swBR+UIaPvHjIWHOkp UNI72Tm6/fZ5kCRtQboGAhffLVWVtyYA0ugJFBbkmQThndq4TF9BaDuwHL6/CjeflDA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796313680; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Received:Received: Received:Received:Received:Date:From:To:CC:Subject:Message-ID: References:Content-Type:Content-Disposition:In-Reply-To: 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-Exchange-RoutingPolicyChecked: 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:X-OriginatorOrg; bh=YSHEnPKNbxUpiuxiZwJvYr3STajU8siEzU7RCjKK6q8=; b=KtLona5ToBFpVJNN6Nu7wyZRP84astxTTiA+2Js81l0faXXBpWNy9eho27fq2HBuT7Fd uJfCcAsMpXXOv945hJxFL9mgbrsacIu/3WHxruamhUvTZtKAXCTtjeciB1OBtQtwN+83l vHEchEozepbSHt7KXZlh0D4Q386MzMkbLFoqrMrbrikoC0HOzjSqHJ6MkeCHOyo/jw5d7 kfl+l4LHGpiFX6YFnwkwp6/fQCGwY0O3VV//7JwxXasoa9LDTS2Vq2v68KvRRiAOnREfD kemtDjSRwjF+vJuT/VbdZc0crR/MpulA8X11Os0n6El/1quuVhmf0G+zVG6jMMq40cQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HmrFxdNO; arc=pass header.oldest-pass=0 smtp.remote-ip=192.198.163.5 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.5]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68412606A32C for ; Thu, 3 Dec 2026 16:01:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68412606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HmrFxdNO DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796313680; x=1827849680; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=vX8tuvNVxeCblPQTdXycYK1gYhVVZFHakb9jmYsYMJY=; b=HmrFxdNOyJAW6UuHf0UTsjQN0iXec+ZCXcxVW5SCShPAbsgxIQYddZTl YUWioX4bCCMkJMVVAH4VsapCw3659ou82oGW7E64kFRNx8dmZ/njx/eTC 4gJm9E94NQTNwM0A1a6zoZdQgcukhXUsZ9rnYZu4kQiHVmXp3opbx31J5 z4t0xmBsV5a5NQBPKTFfSpBVPwYMfrxPkDeSKf4AQAjUXhRkZ+/UD24tO uFOiUUkl+B87ccnKisho8by78KmFw98Z5/Jfgwn1GAduSNYBjZZu3ggOM H+w/lN1TRymVio9+QLdyzEuxjGAAypwhz+nzf7YMKDDXaCYCdtNOOarU1 A==; X-CSE-ConnectionGUID: uO2TO0I7QP2Qx5Jpa4yzyg== X-CSE-MsgGUID: iTSPP8G2TGqaDMY14VXmsA== X-IronPort-AV: E=McAfee;i="6800,10657,11984"; a="19917" X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="19917" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa115.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 08:01:19 -0800 X-CSE-ConnectionGUID: Jyx5NVQTRfudHj1l1u3tqg== X-CSE-MsgGUID: HevVxOhoT/SWJcYvlS0ITQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,248,1794902400"; d="scan'208";a="13643883" Received: from fmsmsx901.amr.corp.intel.com ([10.18.126.90]) by orviesa008.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Dec 2026 08:01:19 -0800 Received: from FMSMSX902.amr.corp.intel.com (10.18.126.91) by fmsmsx901.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Thu, 3 Dec 2026 08:01:17 -0800 Received: from fmsedg903.ED.cps.intel.com (10.1.192.145) by FMSMSX902.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57 via Frontend Transport; Thu, 3 Dec 2026 08:01:17 -0800 Received: from MW6PR02CU001.outbound.protection.outlook.com (52.101.48.21) by edgegateway.intel.com (192.55.55.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Thu, 3 Dec 2026 08:01:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Dd6N9tNskP+2zViDVhuR7rJM0DbxTplxTn9dsdawhnJHoG341wuakLE0pS5kH2kBA2GAaBE61bO40Hltu7F/MiQymso+Oln7hcDzOtHUwuEc0rcr6xOE1zwGm6554QJ2YUCejptgiOWp/SPm1uR6aXbUe+mUoc1D8LiMBAlqvjHlzL2TcAyfuheRQl0huBAotf2x6fgIOCD1ihwXeUnOwJPO/rPY2iWnYurAYj1CjC8t82205Ix7PzTh40uYMdE8tkbxUxe4mrdO90eAVQRlc7q9OgULuDlNUuO2t7mr3EzDxiwBbH0XTYGdp5WGhlz9JH1JvXfzurw8huCeTIY+ZQ== 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=YSHEnPKNbxUpiuxiZwJvYr3STajU8siEzU7RCjKK6q8=; b=T4y7+5JeQ+6JO/hVu6BrCYq5GIDT/smGkIG3oDFTSqeVSTjVemwUPE7LFXpxQjh9VS1BCmyRnRvb/NaKPZkSXHCbpHD4dxoYLy3oWQtYzx58UJD5ZkRmQPDwpA7lCN+ky0mE4Ry5b9OMbz+ygkB5wDXrXhPRQf70f54s8WvyxadTraoQREn7Ol5K/v/H3A11eZmqK17l1higib41puS/mt58opqnEeYiLbOdRwhLK1CVyIjPv76DIths//sjkeIyDP+qpl5ssR0rOS5E9drJ3p/ENOjWFkYnz+2tgbVM8dk0gzONvd9X8ayBEQtt8xZtYqwFBqfbdzyAZ2VA4gmzMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB6020.namprd11.prod.outlook.com (2603:10b6:8:61::19) by SA1PR11MB9825.namprd11.prod.outlook.com (2603:10b6:806:4d7::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Thu, 3 Dec 2026 16:01:10 +0000 Received: from DM4PR11MB6020.namprd11.prod.outlook.com ([fe80::3058:1480:e4ac:5765]) by DM4PR11MB6020.namprd11.prod.outlook.com ([fe80::3058:1480:e4ac:5765%3]) with mapi id 15.21.0688.011; Thu, 3 Dec 2026 16:01:10 +0000 Date: Thu, 3 Dec 2026 23:50:10 +0800 From: Chen Yu To: Reinette Chatre CC: , , , , , , , , , , , Subject: Re: [PATCH v10 05/12] x86/resctrl: Parse ACPI ERDT table and save CACD cpumask per RMD Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: SG2PR06CA0237.apcprd06.prod.outlook.com (2603:1096:4:c8::20) To DM4PR11MB6020.namprd11.prod.outlook.com (2603:10b6:8:61::19) 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: DM4PR11MB6020:EE_|SA1PR11MB9825:EE_ X-MS-Office365-Filtering-Correlation-Id: f841b236-661f-45e9-f79b-08df5156a5d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|366016|23010399003|5023799004|11063799006|4143699003|6133799003|261009223027099003|18002099003|22082099003|3023799007|261022105027099003|56012099006|261026140227099003|10067099003|261026121527099003|261021121427099003|261021123027099003|261028144727099003|261102123227099003|261022075727099003; X-Microsoft-Antispam-Message-Info: KEskPbYm7WaycuXNkihDstxaQdv0tL3M7KhVJuZBzmWmkTdTclpwGtns/EkYVPPl2EUb31S+0FYGJ0jxrt/Hzm5u/99FVW1ETnNE0JZFLAlZCPBwDBAPf8DXkaQfpD77LdesNvNlscA5Ol8NRhCIJk+nZOpDj6fKAOgg/qkyJzo5orz87i9JXSsCVutNa8qc0fNF/ILD0UB6GNkzELhWy7l6lYoP2/XgOZfc8xjtO2AL5WQhAnLeccxkXy6sW7drRKwRojAcAjT1e0vtaFr8d/OjHst3PRWawye6t6nyNgNPRn4LzezWHvNzX3MkA2DoNrkXe4dV+9ugbJgjJsQXoD3M3BSp3FxnhnXBKsJ9ai7iCm7ICCxSBIlNQRBi8PsWsoTLHy48u8KVV9aLBfe+L3oVSVX0iMTix0fTtBVqXZjTMWxSaXdhxSMVFwnjkvqVVu10eJ+OOX4c1svfGrTY/TezeH1zWdwKTZMsCuIqa8jH2tVc816vloxgSYiCTeaTHCcvKp7ckQa2RoovK4+NIGDnmmtV2f0e7MBVi7w2gHVNG8agabn8pgSn4100C7WJlL1ykm5MU6/dGK9x87IUynj6GbV04Q8GlRtLk4U648QAfyXIFjt7USnR2qT9wzTWXUnzuyXDfIkyyDFCOWkn+LOOIQs74awqX7HFpKDGgBQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB6020.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(366016)(23010399003)(5023799004)(11063799006)(4143699003)(6133799003)(261009223027099003)(18002099003)(22082099003)(3023799007)(261022105027099003)(56012099006)(261026140227099003)(10067099003)(261026121527099003)(261021121427099003)(261021123027099003)(261028144727099003)(261102123227099003)(261022075727099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?NrcqYhQud1enmwcoaLiExnqymGPK3aBDUp3NS9jcxHrORG61aZgogVJGdPE/?= =?us-ascii?Q?P8FOcw2MpIC9wSk6HS8DHlTwb4VIxBuvlgw2iiMsCG6jWeah4REF0sJKpwv5?= =?us-ascii?Q?5mAeQNqmrz6sElja94pcPZ/WkIYB6jg1kMptE3B9cd3tPQ1TBSM5K449iRAk?= =?us-ascii?Q?4BiHOsYItFY/W/vgAGecmlH543xYI/kdJ+uLHGQYXQrzMaG77QsJ/YPyQ/Td?= =?us-ascii?Q?r1+z1+pOXOHg2xWEkfj9BEgfMG3dBmRTnaoa6pH5uAfhuDgTX9Nq0KeLi0mM?= =?us-ascii?Q?v77qxLyfTKbcM8QjcTClfYTbPWK/sR8DsNSQOrZOYkJePM4fB2bAe3bbUi4m?= =?us-ascii?Q?CqvgSjbsu8MP+p9ZLxOPPtnRgR7JOC4IOtjHEBoR7vBQ0KCSfXVXBxm3j3c+?= =?us-ascii?Q?Xj9w5RgwuxSSlhXmbRNGq+hWhgrqcl8Q3IQiyWFXYRBN5IrJpfJ+rdba+iAs?= =?us-ascii?Q?O63GC87x4uksoh4z79kV1ETlgEPie5zemokNKzfROHgko7TTO6r6bne2f8FP?= =?us-ascii?Q?amPBT7EjoUzY/Guj6gDVme6GdliotHfCF40wt1XqXO2YcwOJrJI8zkYswrwh?= =?us-ascii?Q?P8l2Rl09331Zs6TXD5MuH8WkgXf4LJYuiixVLFBG+xHpd9461MSZXW6hvpSc?= =?us-ascii?Q?jl78Z4f+6eqWYF1ZMAdjYvkrqS9n/S8j45BOJCDYMwfxkB6H4NHK5I523YDd?= =?us-ascii?Q?L1JiKUds99vH97Bg+aqWdKWLmRtFHOOevncZ+UAVkprIbGWU+dPR6z5UgstQ?= =?us-ascii?Q?NUQwPQa+xF/Q9/ffy20HlzIMeEjVIXBPhusfDC+BS8mPlibgQ7IR3dMRqMu3?= =?us-ascii?Q?LR6ej+H+SpXlWLpC1A4R51kc1yYY027c8g+bFXVlR63luwyNMcNs18Pm0o7t?= =?us-ascii?Q?E4SRYFZhgSzCKclls192ibjdVMQlyLArxdHL87j3knqdF9mYiXSb9B0iW4lT?= =?us-ascii?Q?qHjlpIb3ogpJfKerTavifWut0brZAeLhtxanfSypz4LjR+nPtoCLxExf8NWe?= =?us-ascii?Q?m1+LHzCubGhvh03OEk6BV9aVOYiQSzvdQDqk/uZeLrFtCZgLEL/hxSpsQ3cu?= =?us-ascii?Q?SY9iE0de2BTcF+JGr4SdUUkm66a0wT7oYygbDIRXW8+r0t7IF4MkJ08Gi+Of?= =?us-ascii?Q?83YtENYuFKNvZ6cdADx+TGDA61UEIBxxAiyOrLJc2/LWho5hsd8IgKciNDvO?= =?us-ascii?Q?OT7TmYqqkg1xwOBxJYCB1Z41zyOxa/J0tRxcvOOwpu8FSDeCkDKN3pkyfGRN?= =?us-ascii?Q?EFvY+onUlUhWYiUxv4UK6iq8bvIuuVk4XdpwwfS/oNZbcdt23R62sCgL9BcR?= =?us-ascii?Q?w2XoEJ7y1YLGqQSvdbRlATHWGU7zrt1ER4RPofskOlFqJ0Ks/S19m46+Z+/l?= =?us-ascii?Q?vmF5Lq3FZqX4yJycl3zid87v01Sx1+QixOEirWKCaCDWhMm8snXPh1cDyZ5G?= =?us-ascii?Q?XEuPGsddpfMZ4wpwkDpodsFK+Dvqq1WfIFatmOcVQYrp9LJx0EHw4guGYcrH?= =?us-ascii?Q?SpPZI6dTj7hpaokeev8LhUqlK7jJN8l5zSbtFPNLqfzJFD5FJbYp9LDSZAKW?= =?us-ascii?Q?L1lfgh4LQUgQg5hDB9TNwb0nILSMOgU98ELjvm2LyHek3jDWSW7jk8pxN48y?= =?us-ascii?Q?M9qwUBJafWqKKOtMefzMUnr3K9ZJ93oslihRnUi76hNxvYcF+Qvvnojxiz5P?= =?us-ascii?Q?Hk9oxJH5vFH34yzqG7FO6KcXoVa1jXwnJYTTWvL+PsDxUDRNifBBCxmGrzdh?= =?us-ascii?Q?lDoiGTdUAw=3D=3D?= X-Exchange-RoutingPolicyChecked: hVlxTPprG9Us/sUIrlGkrnkMlMIBfJHzzk5iiYTTjGu3MHSQdIrzFXYXkjph8UQOQrs8uShz7DSoVHQb9oizSjeRyMnhPEyqNIrmHp0JjJ8aHawLvFvD8l7d4oqsyo6gv1H73XNvFvzKH0jL3fvgbcXkVtx14COTOzejGOatJbAfsqAbd0RBsIeXaEP1ysy4vhXaUYcMcDODvxrDAKE2mplLh5JBwiscNk1RLfMzeCMSXTppeZcvrNw9HddZMq51jN2U14iPzmwINDHUzDGxtOv+NZrmG16tAPu+3RtJPN/c0RkYTXfS3bAx/feRdyFIFyJCgArzzvvrwqZ+XHGNiA== X-MS-Exchange-CrossTenant-Network-Message-Id: f841b236-661f-45e9-f79b-08df5156a5d7 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB6020.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2026 16:01:10.4877 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: d9XSRCEF00T+Cc2w13ZwQy8vOLIw5YNJeNx0DNWushBFqJfEQqJB2toYg8i2v9BiuSIvrPdkKqz9QhG4foCPhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB9825 X-OriginatorOrg: intel.com Hi Reinette, On Wed, Dec 02, 2026 at 11:12:26AM -0800, Reinette Chatre wrote: > Hi Chenyu, > > On 11/26/26 6:44 AM, Chen Yu wrote: > > On Wed, Nov 25, 2026 at 11:04:38AM -0800, Reinette Chatre wrote: > >> On 11/5/26 2:08 AM, Chen Yu wrote: > >> ... > >> > >>> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c > >>> index b5a86e5aa4e3..2b9a13be5975 100644 > >>> --- a/arch/x86/kernel/cpu/resctrl/core.c > >>> +++ b/arch/x86/kernel/cpu/resctrl/core.c > >>> @@ -1018,11 +1018,18 @@ static __init void check_quirks(void) > >>> > >>> static __init bool get_rdt_resources(void) > >>> { > >>> + bool ret; > >>> + > >>> snc_nodes_per_l3_cache = snc_get_config(); > >>> + erdt_init(); > >>> rdt_alloc_capable = get_rdt_alloc_resources(); > >>> rdt_mon_capable = get_rdt_mon_resources(); > >>> > >>> - return (rdt_mon_capable || rdt_alloc_capable); > >>> + ret = (rdt_mon_capable || rdt_alloc_capable); > >>> + if (!ret) > >>> + erdt_exit(); > >>> + > >>> + return ret; > >>> } > >> > >> Looking at the solution as a whole I do not think that this enumeration is > >> ideal. erdt_init() sets erdt_enabled irrespective of > >> erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC) being true. Specifically, a user > >> may boot with "rdt=!cmt", which is the only ERDT enabled feature, and that > >> will result in erdt_enabled being true but that does not actually mean "ERDT > >> is in use". > >> > >> I think there is a real problem because of this when looking at the CPU > >> online code that gates the domain binding and configuration on erdt_enabled. > >> If I understand correctly a CACD inconsistency drops the CPU out of _every_ > >> L3 CAT, L2 CAT, MBA and MBM domain, even though no ERDT data is ever read. > >> > >> This looks to be a recurring problem and so far the solution has been to > >> add additional gates based on erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC) at various places, > >> but I wonder if this can be simplified by changing the contract. > >> > >> Instead of erdt_enabled meaning: > >> /* True when the ERDT ACPI table describes at least one domain with at least one CPU. */ > >> could it mean (something like) > >> /* ERDT is in use */ ? > >> > > > > OK, does "ERDT is in use " stand for: > > > > At least one ERDT feature in "MMIO-based CMT, region-aware MBM, region-aware MBA" > > is enabled on this system? > > That is more accurate, yes. I do not know how you intend to use this list, if it > is just to replace the existing comment it may be something that could easily become > out of date as new features are added. > OK, to keep it non-feature-dependent, let me rephrase it to " True when ERDT is in use, i.e. at least one feature is backed by ERDT. " > > > >> What do you think of changing the enumeration to something like: > >> get_rdt_mon_resources() > >> { > >> ... > >> if (rdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC)) { > >> erdt_init(); > >> if (!erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC)) > >> erdt_exit(); > >> resctrl_enable_mon_event(QOS_L3_OCCUP_EVENT_ID, > >> erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC), > >> 0, NULL); > >> ret = true; > >> } > >> ... > >> } > >> > >> Wouldn't this simplify the enumeration and subsequent domain management? For example, > >> with ERDT established by the time monitoring enumeration starts the values for RMID and scale > >> can be returned directly (since they have been reset, if needed, by erdt_exit()). > >> > >> I understand this ties erdt_init() to CMT lifetime while ERDT clealy has bigger plans. > >> When the ERDT scope expands, so can its initialization. > >> > >> ... > >> > > > > I agree that erdt_enabled seems to be independent of whether the system finally > > decides to use ERDT - for example, rdt=!cmt will leave erdt_enabled = true, but > > the system does not use MMIO-based CMT. The root cause is as you mentioned: > > erdt_init() is unaware of whether the user wants to use it or not. Although moving > > erdt_init() into get_rdt_mon_resources() and clearing erdt_enabled in erdt_exit() > > if the user does not want to use it would be doable, the code would have to be > > adjusted when introducing region-aware MBA/MBM. After all, erdt_init() was supposed > > to initialize ERDT information for all features, and should be called once. Do you > > think it doable to move the erdt_cpu_has() check into erdt_init(), rather than > > moving erdt_init() into get_rdt_mon_resources(), and invoking erdt_exit() inside > > erdt_init() if the user does not want to use the feature? After this change, we can > > remove the erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC) check in erdt_get_cmt_max_rmid() > > and erdt_get_cmt_scale() > > > > +static __init bool erdt_in_use(void) > > +{ > > + return erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC); > > +} > > + > > __init void erdt_init(void) > > { > > acpi_table_parse(ACPI_SIG_ERDT, enumerate_erdt_table); > > + > > + if (!erdt_in_use()) > > + erdt_exit(); > > } > > This looks good to me. > > I agree that the erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC) check in erdt_get_cmt_max_rmid() > can be removed. Even more I think erdt_get_cmt_max_rmid() can now be renamed to > erdt_get_max_rmid() (with its function comment reworked). > Agree, it is shared by all monitor. > I do not think the erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC) should be removed from > erdt_get_cmt_scale() since it supports that the function is CMT specific. Could you > elaborate here? erdt_get_cmt_scale() should rely on the X86_FEATURE_CQM_OCCUP_LLC check, because this scale is tied to the LLC occupancy calculation only. Using erdt_enabled alone can not decide whether ERDT CMT is supported. > > One difference between the two proposals is that above will parse ERDT tables > even though it is already known at the time that ERDT will not be used. If user > boots with rdt=!cmt then ERDT will be parsed and then immediately torn down. If > there are any ERDT related messages printed during parsing then they will appear > in the logs while ERDT is never used. OK, parsing the ERDT even when asked not to might confuse the userspace. > > One option to deal with this may be something like: > > /* > * ERDT can only be used for a feature that the CPU enumerates and the user has > * not disabled. Keep in sync with erdt_in_use(). > */ > static __init bool erdt_may_be_used(void) > { > return rdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC); > } > > /* ERDT is in use when at least one feature is backed by ERDT. */ > static __init bool erdt_in_use(void) > { > return erdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC); > } > > __init void erdt_init(void) > { > if (!erdt_may_be_used()) > return; > > acpi_table_parse(ACPI_SIG_ERDT, enumerate_erdt_table); > > if (!erdt_in_use()) > erdt_exit(); > } > > The cost here is that the two functions always need to be kept in sync. > This could be supported by a helper but with only one feature it is perhaps > something for the next feature. > I see. With the above change, it would skip ERDT parsing if none of the ERDT features is supported or none of the features are requested by the user. > One issue that remains seems unlikely? When more ERDT features are supported > then an issue during parsing of a user-disabled feature would impact all ERDT > features. One option here is to move the rdt_cpu_has() check into parse_rmdd_table() > so that the feature specific table is only parsed when the CPU enumerates the feature. > If I understand correctly, what you mean is a case like below. Say ERDT later also backs MBM (via MMRC table): 1. The user boots with rdt=!mbmtotal,!mbmlocal. 2. CMT is still wanted, so erdt_may_be_used() is true and the whole ERDT table is parsed. 3. The MMRC is broken, so mmrc_init() fails. 4. parse_rmdd_table() fails and ERDT is torn down completely, so victim CMT loses its MMIO support. I'm thinking of adding this erdt_may_be_used() check in erdt_init() in the current commit, but in a later commit, when CMRC parsing is introduced in ("x86/resctrl: Parse ACPI CMRC table"), remove this erdt_may_be_used() in erdt_init(), and delegate to parse_rmdd_table() to skip the CMRC if the user asks to do so: case ACPI_ERDT_TYPE_CMRC: + if (!rdt_cpu_has(X86_FEATURE_CQM_OCCUP_LLC)) + break; + if (subtbl_mask & BIT(ACPI_ERDT_TYPE_CMRC)) break; if (!cmrc_init(subtbl, domain_info)) goto cleanup; subtbl_mask |= BIT(ACPI_ERDT_TYPE_CMRC); break; By the way, since current commit needs to use erdt_cpu_has(), I'm also thinking of moving the commit "x86/resctrl: Introduce erdt_cpu_has() and erdt_support()" before current commit. thanks, Chenyu