Re: [RFC PATCH v3 03/17] x86/resctrl: Detect Assignable Bandwidth Monitoring feature details

From: Reinette Chatre
Date: Thu May 09 2024 - 23:18:19 EST


Hi Babu,

On 5/9/2024 3:34 PM, Moger, Babu wrote:
> Hi Reinette,
>
> On 5/7/24 15:27, Reinette Chatre wrote:
>> Hi Babu,
>>
>> On 5/6/2024 12:09 PM, Moger, Babu wrote:
>>> On 5/3/24 18:26, Reinette Chatre wrote:
>>>> On 3/28/2024 6:06 PM, Babu Moger wrote:
>>
>> ...
>>
>>>>> + * @mbm_assign_cntrs: Maximum number of assignable counters
>>>>> */
>>>>> struct rdt_resource {
>>>>> int rid;
>>>>> @@ -188,6 +198,8 @@ struct rdt_resource {
>>>>> struct list_head evt_list;
>>>>> unsigned long fflags;
>>>>> bool cdp_capable;
>>>>> + bool mbm_assign_capable;
>>>>> + u32 mbm_assign_cntrs;
>>>>> };
>>>>
>>>> Please check tabs vs spaces (in this whole series please).
>>>
>>> Sure. Will do.
>>>
>>>>
>>>> I'm thinking that a new "MBM specific" struct within
>>>> struct rdt_resource will be helpful to clearly separate the MBM related
>>>> data. This will be similar to struct resctrl_cache for
>>>> cache allocation and struct resctrl_membw for memory bandwidth
>>>> allocation.
>>>
>>> Did you mean to move all the fields for monitoring to move to new struct?
>>>
>>> Struct resctrl_mbm {
>>> int num_rmid;
>>> bool mbm_assign_capable;
>>> u32 mbm_assign_cntrs;
>>> }:
>>>
>>
>> Indeed, so not actually MBM specific but monitoring specific as you state (with
>> appropriate naming?). This is purely to help organize data within struct rdt_resource
>> and (similar to struct resctrl_cache and struct resctrl_membw) not a new
>> structure expected to be passed around. I think evt_list can also be a member.
>
> How about this?
>
> Lets keep assign_capable in main structure(like we have mon_capable) and
> move rest of them into new structure.
>
> Struct resctrl_mon {
> int num_rmid;
> struct list_head evt_list;
> u32 num_assign_cntrs;
> }:

This looks like a good start. It certainly supports ABMC. I do not yet
have a clear understanding about how this will support MPAM and soft-RMID/ABMC
since the current implementation has an implicit scope of one counter per event per
monitor group. It thus seem reasonable to have a new generic name of "cntrs".

Reinette