Re: [PATCH v2 33/45] arm_mpam: resctrl: Allow resctrl to allocate monitors

Jonathan Cameron
2026-01-06T14:37:58Z

On Fri, 19 Dec 2025 18:11:35 +0000
Ben Horgan <ben.horgan@arm.com> wrote:

> From: James Morse <james.morse@arm.com>
>
> When resctrl wants to read a domain's 'QOS_L3_OCCUP', it needs to allocate
> a monitor on the corresponding resource. Monitors are allocated by class
> instead of component.
>
> MBM monitors are much more complicated, if there are enough monitors, they
> will be pre-allocated and free-running. If ABMC is in use instead then
> 'some' are pre-allocated in a different way, and need assigning.
>
> Add helpers to allocate a CSU monitor. These helper return an out of range
> value for MBM counters.
>
> Allocating a montitor context is expected to block until hardware resources

monitor

> become available. This only makes sense for QOS_L3_OCCUP as unallocated MBM
> counters are losing data.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
> ---
> Changes since rfc:
> USE_RMID_IDX -> USE_PRE_ALLOCATED in comment
> Remove unnecessary arch_mon_ctx = NULL
As with some other patches, I'm not taking the time at this point to dig
into all the interactions with resctl as others will cover that much better
than me.

Too much to get done :(

With that in mind.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

J