Re: [RFC PATCH v3 09/17] x86/resctrl: Introduce assign state for the mon group

From: Moger, Babu
Date: Tue Apr 16 2024 - 15:53:14 EST


Hi Peter,

On 4/16/24 13:52, Peter Newman wrote:
> Hi Babu,
>
> On Thu, Mar 28, 2024 at 6:08 PM Babu Moger <babu.moger@xxxxxxx> wrote:
>>
>> +/*
>> + * monitor group's state when ABMC is supported
>> + */
>> +#define ASSIGN_NONE 0
>> +#define ASSIGN_TOTAL BIT(0)
>> +#define ASSIGN_LOCAL BIT(1)
>
> We already have an enumeration for the monitoring events (i.e.,
> QOS_L3_MBM_TOTAL_EVENT_ID), which should already be suitable for
> maintaining a bitmap of which events have assigned monitors.
>

/*
* Event IDs, the values match those used to program IA32_QM_EVTSEL before
* reading IA32_QM_CTR on RDT systems.
*/
enum resctrl_event_id {
QOS_L3_OCCUP_EVENT_ID = 0x01,
QOS_L3_MBM_TOTAL_EVENT_ID = 0x02,
QOS_L3_MBM_LOCAL_EVENT_ID = 0x03,
};

I think you are referring to this definition. We need just one bit for
each event. The QOS_L3_MBM_LOCAL_EVENT_ID definition(both bit 0 and bit 1
set here) does not work for us here.

I can change the definition to something like this.

+#define ASSIGN_NONE 0
+#define ASSIGN_TOTAL BIT(QOS_L3_MBM_TOTAL_EVENT_ID)
+#define ASSIGN_LOCAL BIT(QOS_L3_MBM_LOCAL_EVENT_ID)

Is that what you meant?

--
Thanks
Babu Moger