[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5310acf5-0d6b-475b-a2e3-8071757d1735@amd.com>
Date: Fri, 16 Aug 2024 15:39:15 -0500
From: "Moger, Babu" <babu.moger@....com>
To: James Morse <james.morse@....com>
Cc: x86@...nel.org, hpa@...or.com, paulmck@...nel.org, rdunlap@...radead.org,
tj@...nel.org, peterz@...radead.org, yanjiewtw@...il.com,
kim.phillips@....com, lukas.bulwahn@...il.com, seanjc@...gle.com,
jmattson@...gle.com, leitao@...ian.org, jpoimboe@...nel.org,
rick.p.edgecombe@...el.com, kirill.shutemov@...ux.intel.com,
jithu.joseph@...el.com, kai.huang@...el.com, kan.liang@...ux.intel.com,
daniel.sneddon@...ux.intel.com, pbonzini@...hat.com, sandipan.das@....com,
ilpo.jarvinen@...ux.intel.com, peternewman@...gle.com,
maciej.wieczor-retman@...el.com, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, eranian@...gle.com, tglx@...utronix.de,
mingo@...hat.com, dave.hansen@...ux.intel.com, bp@...en8.de, corbet@....net,
fenghua.yu@...el.com, reinette.chatre@...el.com
Subject: Re: [PATCH v6 09/22] x86/resctrl: Introduce MBM counters bitmap
Hi James,
On 8/16/24 11:29, James Morse wrote:
> Hi Babu,
>
> On 06/08/2024 23:00, Babu Moger wrote:
>> Hardware provides a set of counters when mbm_cntr_assignable feature is
>> supported. These counters are used for assigning the events in resctrl
>> group when the feature is enabled.
>>
>> Introduce mbm_cntrs_free_map bitmap to track available and free counters
>> and set of routines to allocate and free the counters.
>
>
>> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> index ab4fab3b7cf1..c818965e36c9 100644
>> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
>> @@ -185,6 +185,37 @@ bool closid_allocated(unsigned int closid)
>> return !test_bit(closid, &closid_free_map);
>> }
>>
>> +/*
>> + * Counter bitmap for tracking the available counters.
>> + * ABMC feature provides set of hardware counters for enabling events.
>> + * Each event takes one hardware counter. Kernel needs to keep track
>> + * of number of available counters.
>> + */
>> +static DECLARE_BITMAP(mbm_cntrs_free_map, 64);
>
> Please make this resctrl limit of '64' a define in linux/resctrl.h so the arch code knows
> what the limit is!
>
> MPAM platforms may have more than this - and really bad things happen if mbm_cntrs_init()
> passes bitmap_fill() a value greater than 64.
>
> Even better - could we dynamically allocate this bitmap using the size advertised by the
> architecture code?
Yes. Actually, I was thinking about allocating it dynamically. It needs
few other changes as well. Will do it.
--
Thanks
Babu Moger
Powered by blists - more mailing lists