Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp90474lqo; Tue, 7 May 2024 13:08:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWyOK8c39xY/c9sc8TzjVYu97yhh3m/nOpcaWgvR5SoPc39u+GUsOMqxvyEXNb7QyS+xeV/o6IpLLbxKEtVoQZZZwPmWOH7ahmJdFw+wQ== X-Google-Smtp-Source: AGHT+IF+e9b5N30CzaRvbrSkd0nRMtoml6a6Ff80kM36SPMAMLYVhxTLWJ48etT2SoKjvyQL4CgE X-Received: by 2002:ad4:5bc4:0:b0:6a0:ae8a:e8ba with SMTP id 6a1803df08f44-6a151432519mr9575116d6.10.1715112537712; Tue, 07 May 2024 13:08:57 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id p12-20020a05622a13cc00b0043ae9c8be0fsi12476557qtk.629.2024.05.07.13.08.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 13:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=VGH2pOsC; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-172123-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172123-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4ECB81C24C78 for ; Tue, 7 May 2024 20:08:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41BB3170828; Tue, 7 May 2024 20:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="VGH2pOsC" Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2069.outbound.protection.outlook.com [40.107.101.69]) (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 54FE614B964; Tue, 7 May 2024 20:03:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.69 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715112216; cv=fail; b=ebhxMnYdCaGpbyPZoTqGZEeXPLLX3hR+5981BWiX4zt4OyhECtHWPDY1M7siUuS9zOuxEXuXtTcL/uKHuBGC9KqhhtI2n8ZnWIxJS1pHlb4lebpwPIanGlWT6rYUO+hRH7z1kFf51VDSTqxgrIssvtVCMkVE78rusZyhA8cXRTE= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715112216; c=relaxed/simple; bh=QwoTZStXdkBVBkhNuDpl++Hzrodkht1xkG+dqGxybbU=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=Drq704ogdH9hTkuq57RBoK8avQKhjkusYc3Dvag51B0yh2v0cBVZOewxzR0+BRZQud33DTwSMLIvYNnrUPNnGNlqE8tAnWZiS12T/jDUlwf+OVSg9Tw4m8v6lw/0gXn++6drFpKbkqMeEOmCBmzTFkdyh/+e4PXkBqTrtIMUfRM= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=VGH2pOsC; arc=fail smtp.client-ip=40.107.101.69 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 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PTllCNTOBK3pxQQ2XN2fXKTrD7WGMxi0s5xK8JS07Lq1U8SXieTCD+ddyhEIQe/1rPQxP4AiLWvGMmsQFIGmpDrpQ9Y4xYuY3F9f7CJTgCDwpsO9prCinq0o2C+FJu7LsqJDxYjqGr9h1YQy07tmNm+sumYwzLOMQ2AiMLqakNqLwY+ZbL6nrns3O37R9hKuE9poN2k0DO1OUzeIiO6gtJqiLWtFYMn3B3N2AiYagbKevvQlE004fPhql38g/+WS9C/kxkPqb4JJOWvyEK/JfDaHeHwrhZsk8UvItrw2iE7XCLp5NlDY4oaf8bkImfRngTIkGMhFuNIv4JiGsBf6zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=V4ndVPotJTVXbxdc+CLwXvLt9EoWRTqn5eAFeE9UQro=; b=F2sm17n9GDNvTLa23F6nllatCQN78TVf8oK3Ba+YfUTyKa4aL90gJlBPnJ9UaUllZzSnFOLde23AsAKX5kdL4DmPjf+PFJ0Fv0y0zJYiD/q7PjrfIhnfANqwXXJ0YtjAj3NZIrPBmYic1VCXGjCBWEZf2nMGI/OL3RVQBNkHCfi+yYgHzTQruIo1A0cj3PGahv3sHrn2h3HDM1irYYErg0SPhnXpWcE3sms31yaA6E2UIeurcqCBjODyunvei/w8GpxYzkADOhbVGzpMwwALSZPl2fcTDAbfcUKJkYlvWBwLkD/CsyZZT6UP03Ar+RcygWsZ5CERTO/BhJSsl+l87A== 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=V4ndVPotJTVXbxdc+CLwXvLt9EoWRTqn5eAFeE9UQro=; b=VGH2pOsCRlLfGvLlc38AWZInPvDqpKjW1FRqg//XMdhRm8J3GolM2388We4qxc0SlVbmv98P/xrtNMBzJXpEI3ZgLqBv6FFEx2ant540TqyhTfKjoeUDZFBsSfxjgRFY0hdWUgPRwaXSM/xkZRQlHA0+4oyT6s2WkugGp2uXeCM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) by DS0PR12MB7801.namprd12.prod.outlook.com (2603:10b6:8:140::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.41; Tue, 7 May 2024 20:03:31 +0000 Received: from MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::b0ef:2936:fec1:3a87]) by MW3PR12MB4553.namprd12.prod.outlook.com ([fe80::b0ef:2936:fec1:3a87%4]) with mapi id 15.20.7544.041; Tue, 7 May 2024 20:03:30 +0000 Message-ID: Date: Tue, 7 May 2024 15:03:26 -0500 User-Agent: Mozilla Thunderbird Reply-To: babu.moger@amd.com Subject: Re: [RFC PATCH v3 08/17] x86/resctrl: Initialize assignable counters bitmap To: Reinette Chatre , corbet@lwn.net, fenghua.yu@intel.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, paulmck@kernel.org, rdunlap@infradead.org, tj@kernel.org, peterz@infradead.org, yanjiewtw@gmail.com, kim.phillips@amd.com, lukas.bulwahn@gmail.com, seanjc@google.com, jmattson@google.com, leitao@debian.org, jpoimboe@kernel.org, rick.p.edgecombe@intel.com, kirill.shutemov@linux.intel.com, jithu.joseph@intel.com, kai.huang@intel.com, kan.liang@linux.intel.com, daniel.sneddon@linux.intel.com, pbonzini@redhat.com, sandipan.das@amd.com, ilpo.jarvinen@linux.intel.com, peternewman@google.com, maciej.wieczor-retman@intel.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, eranian@google.com, james.morse@arm.com References: Content-Language: en-US From: "Moger, Babu" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DM6PR07CA0073.namprd07.prod.outlook.com (2603:10b6:5:337::6) To MW3PR12MB4553.namprd12.prod.outlook.com (2603:10b6:303:2c::19) 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: MW3PR12MB4553:EE_|DS0PR12MB7801:EE_ X-MS-Office365-Filtering-Correlation-Id: 4739163e-bd27-4e3e-96b8-08dc6ed0c46e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|366007|376005; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZGd1TUVVbCtpcEhLQzgzSUFoaGZiOGRJUUN4NmFxMmFURmdZRDRxcjV5c1ZH?= =?utf-8?B?b3ZDeTJTY2ZmV01jRzJGZ0J2SElHUGtheVFsVG1MbUlPclNpL21QZnJoY0Va?= =?utf-8?B?S3JmK1VxL0N4dmM4TmhPOEF1NUw5cUpIdmRhYStVRkVxenNiMmFkYlcxQkt6?= =?utf-8?B?OG9vaS9BZjEwUEpGM1A0eWZQZERISTM2aWFkSjIwVVd1REZaRmovM005Y2sz?= =?utf-8?B?N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grcFFvZ1pQ?= =?utf-8?B?VlAvYUhqZStvK1g0Z0dSbnp4bjZ4RzlsZ1F4b3EzT3lrUk9xNSs5Y0NSUVBW?= =?utf-8?B?UDBISzlMRDBRcnRIa2FMamU2d1hhaDM5SDRKaXh1RUhzNU5LNG5MeS9nRjdt?= =?utf-8?B?UjBwdnQ1T0pPS09CT2JJZkR0Y01CMzdFRWdOL2U0U3FZZkNJSFVhZzd1R3FW?= =?utf-8?B?SVpXZVZKWWROa3NSMWhnLytHbmg2VWg0UFkyYW45M095bHVmcDRDZ0Y0bWd6?= =?utf-8?B?dGVIdkd0aVJiaDhHVkh5UU1hb05SOWZ1RFA4S0gydG5FMy83aUNXL0RFMGxG?= =?utf-8?B?aTVsTnpOZDV1S1pjOTIrSUtHRVg3S3J2akl5VndwSklrWjhCYWxqbmIvQzAw?= =?utf-8?B?c0NrVklXYnNBV0t3Tk9KRmZ2dUhLaXdTVCtSSUJFaExrUmhOQndQejFZOUQ2?= =?utf-8?B?VDh4bVM1UmtkMlVEZnhBdHZDcG43RS9FbXE4czB6eW1ta3ZlSWo1SUVScDd4?= =?utf-8?B?RkFnSjRpdmFHK1dqTHVlZzVKL0RUaFFFYTJGRGxNS3YrUkxObDVPQWlZUW1o?= =?utf-8?B?cjdaYS94Wm5LWlZRT0V3dnlpWVpRTFRBNE1CVmpmc3lkcUswVnV5Qk5BPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4553.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(7416005)(366007)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aXRLa0pBYlhJZ0VoNjJFWk9JQlRIQzdGU05JVkZoenJONHVTbjF6UUlNaysr?= =?utf-8?B?bGNpemJEd2d4RHh6N3dHcmVTU1Bsb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?B?MTdUWGlQUE90djBKeE54RXRmWkZjbkd6VjJNVEJrY3pxYmw5KzVPSk9VM3Nm?= =?utf-8?B?Z04xRTN5SFg2WDNqb0R6ak1pV0s2dmlNaWo0UTZ2dVNpRHIvdXEzbVMrY0Y2?= =?utf-8?B?bXRXY0tuOVFBSTFIVmxzUy9rY1UzTnAzckU5NzNOVWgwNmtkZFR3OFZ2Mnk3?= =?utf-8?B?WUt4eld1UDh5ZisrNEpYYUFmSWFLU2NxYnJkdTRGOU9GWUgvTmJWZ1RMckV1?= =?utf-8?Q?85vY=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4739163e-bd27-4e3e-96b8-08dc6ed0c46e X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4553.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 May 2024 20:03:30.8991 (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: MXEqs1AgKBRzoSnw1syowPcGsJqISlh6Q/+4xTcxAnUWrAI6KPP7Vl8pqwIsrtSK X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7801 Hi Reinette, On 5/3/24 18:31, Reinette Chatre wrote: > Hi Babu, > > On 3/28/2024 6:06 PM, Babu Moger wrote: >> AMD Hardware provides a set of counters when the ABMC feature is supported. >> These counters are used for assigning events to the resctrl group. >> >> Introduce the bitmap assign_cntrs_free_map to allocate and free the >> counters. >> >> Signed-off-by: Babu Moger >> >> --- >> v3: Changed the bitmap name to assign_cntrs_free_map. Removed abmc >> from the name. >> >> v2: Changed the bitmap name to assignable_counter_free_map from >> abmc_counter_free_map. >> --- >> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 19 +++++++++++++++++++ >> 1 file changed, 19 insertions(+) >> >> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> index f49073c86884..2c7583e7b541 100644 >> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c >> @@ -186,6 +186,22 @@ bool closid_allocated(unsigned int closid) >> return !test_bit(closid, &closid_free_map); >> } >> >> +static u64 assign_cntrs_free_map; >> +static u32 assign_cntrs_free_map_len; > > Please provide summary in comments about what these globals are and how they > are used. > Sure. >> + >> +static void assign_cntrs_init(void) >> +{ >> + struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl; >> + >> + if (r->mbm_assign_cntrs > 64) { >> + r->mbm_assign_cntrs = 64; >> + WARN(1, "Cannot support more than 64 Assignable counters\n"); > > I am a bit confused here. The configuration registers are introduced in patch #10 > and if I counted right there are 5 bits for the counter id. It thus seems to me > as though there needs to be some checking during enumeration time to ensure > that all counters enumerated can be configured. Ok. I will remove this check here and move it to enumeration time in rdt_get_mon_l3_config. > >> + } >> + >> + assign_cntrs_free_map = BIT_MASK(r->mbm_assign_cntrs) - 1; > > Please use bitmap API. For example, bitmap_fill() Ok. Sure. > >> + assign_cntrs_free_map_len = r->mbm_assign_cntrs; >> +} >> + >> /** >> * rdtgroup_mode_by_closid - Return mode of resource group with closid >> * @closid: closid if the resource group >> @@ -2459,6 +2475,9 @@ static int resctrl_abmc_setup(enum resctrl_res_level l, bool enable) >> struct rdt_resource *r = &rdt_resources_all[l].r_resctrl; >> struct rdt_domain *d; >> >> + /* Reset the counters bitmap */ >> + assign_cntrs_init(); >> + > > (At this point it is unclear when resctrl_abmc_setup() is called to understand > if reset of bitmap may be appropriate. Please do expand all changelogs to help > readers along with how this implementation is intended to work.) resctrl_abmc_setup() is called either while enabling or disabling the ABMC feature. In both these cases the bitmap assign_cntrs_free_map needs to be reset. Will add comments here, > >> /* Update QOS_CFG MSR on all the CPUs in cpu_mask */ >> list_for_each_entry(d, &r->domains, list) { >> on_each_cpu_mask(&d->cpu_mask, resctrl_abmc_msrwrite, &enable, 1); > > Reinette > -- Thanks Babu Moger