Re: [RFC PATCH v2 10/10] arm_mpam: resctrl: Update the comment on monitoring domain setup
From: Ben Horgan
Date: Tue Nov 03 2026 - 12:12:33 EST
Hi Reinette,
On 19/10/2026 23:07, Reinette Chatre wrote:
> The comment in mpam_resctrl_setup_mon_domain() explains that the L3
> component IDs need to be used for a monitoring domain because there may
> be no control component for the L3. It also describes searching each
> event's class for a component with overlapping CPUs.
>
> Neither matches the code. The monitoring domain has its own structure
> and is set up independently of the control domain, so whether a control
> component exists has no bearing on it. Each event's class must have a
> component that contains the CPU, and all components of the domain must
> cover the same CPUs, which is stricter than overlapping.
>
> Rewrite the comment to say where the domain's ID comes from and what is
> required of the components that back the domain's events.
>
> No functional change.
>
> Signed-off-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
> ---
> Note to maintainers: This comment update is kept as a separate patch to
> make it easy to review. It can be folded into "arm_mpam: resctrl: Give
> the monitoring domain its own structure" and "arm_mpam: resctrl: Require
> monitoring components to cover the same CPUs" if preferred.
Yes, I think squashing those 3 patches together would be good.
Thanks,
Ben
> ---
> drivers/resctrl/mpam_resctrl.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
> index c3ea61a40bb2..61fbde9c0960 100644
> --- a/drivers/resctrl/mpam_resctrl.c
> +++ b/drivers/resctrl/mpam_resctrl.c
> @@ -1647,11 +1647,12 @@ static int mpam_resctrl_setup_mon_domain(unsigned int cpu,
> int err;
>
> /*
> - * Even if the monitor domain is backed by a different
> - * component, the L3 component IDs need to be used... only
> - * there may be no ctrl_comp for the L3.
> - * Search each event's class list for a component with
> - * overlapping CPUs and set up the dom->mon_comp array.
> + * The monitoring domain takes the L3 cache ID as its ID even when its
> + * events are backed by components of other classes, see
> + * mpam_resctrl_pick_domain_id().
> + * Find the component of each event's class that contains the CPU and
> + * set up the dom->mon_comp array. All these components must cover the
> + * same CPUs.
> */
>
> for_each_mpam_resctrl_mon(mon, eventid) {