Re: [PATCH v3 1/8] arm_mpam: resctrl: Add a helper to find the component counting an event

From: Reinette Chatre

Date: Fri Nov 20 2026 - 14:31:39 EST


Hi Ben,

On 11/18/26 8:28 AM, Ben Horgan wrote:
> On 10/11/2026 04:19, Reinette Chatre wrote:

...

>> +/*
>> + * find_mbwu_mon_comp() - Find the component counting @eventid in a domain
>> + * @d: The monitoring domain to search.
>> + * @eventid: The event to find the counting component for.
>> + *
>> + * The counters reached through this component are the monitors MPAM
>> + * pre-allocated for bandwidth counting. Cache occupancy is not counted by> + * those monitors, it is read on demand via resctrl_arch_rmid_read().
>> + *
>> + * Return: the component counting @eventid in @d, or an error pointer when
>> + * MPAM is disabled, when @eventid is cache occupancy, or when no class was
>> + * picked to count @eventid.
>> + */
>> +static struct mpam_component *find_mbwu_mon_comp(struct rdt_l3_mon_domain *d,
>> + enum resctrl_event_id eventid)
>
> I find this a somewhat strange helper. It's operation is not mbwu specific except for its rejection
> of CSU events and it doesn't support the similar code in resctrl_arch_rmid_read(). Something a bit
> more general that just finds the monitoring component is easier to understand for me.
>
> What do you think of something like the change below? (The baseline is unhelpful, as it's your
> series with the first patch removed and the build fixed but hopefully it illustrates the idea well
> enough.)
>

Thank you very much for the snippet. This looks good to me. I'll incorporate it
in the next version.

Also, thank you very much for the reviews of the other patches in this
series.

Reinette