[PATCH v6 29/40] arm_mpam: resctrl: Allow resctrl to allocate monitors

Gavin Shan gshan at redhat.com
Mon Mar 23 20:41:09 PDT 2026


On 3/14/26 12:46 AM, Ben Horgan wrote:
> From: James Morse <james.morse at 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.
> 
> 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
> become available. This only makes sense for QOS_L3_OCCUP as unallocated MBM
> counters are losing data.
> 
> Tested-by: Gavin Shan <gshan at redhat.com>
> Tested-by: Shaopeng Tan <tan.shaopeng at jp.fujitsu.com>
> Tested-by: Peter Newman <peternewman at google.com>
> Tested-by: Zeng Heng <zengheng4 at huawei.com>
> Tested-by: Punit Agrawal <punit.agrawal at oss.qualcomm.com>
> Reviewed-by: Zeng Heng <zengheng4 at huawei.com>
> Reviewed-by: Shaopeng Tan <tan.shaopeng at jp.fujitsu.com>
> Reviewed-by: Jonathan Cameron <jonathan.cameron at huawei.com>
> Signed-off-by: James Morse <james.morse at arm.com>
> Signed-off-by: Ben Horgan <ben.horgan at arm.com>
> ---
> Changes since rfc:
> USE_RMID_IDX -> USE_PRE_ALLOCATED in comment
> Remove unnecessary arch_mon_ctx = NULL
> 
> Changes since v2:
> Add include of resctrl_types.h as dropped from earlier patch
> 
> Changes since v3:
> Don't mention ABMC in commit message
> 
> Changes since v5:
> Remove MBM free running sentence from commit message
> kmalloc -> kmalloc_obj
> ---
>   drivers/resctrl/mpam_internal.h | 14 ++++++-
>   drivers/resctrl/mpam_resctrl.c  | 67 +++++++++++++++++++++++++++++++++
>   include/linux/arm_mpam.h        |  5 +++
>   3 files changed, 85 insertions(+), 1 deletion(-)
> 

Reviewed-by: Gavin Shan <gshan at redhat.com>




More information about the linux-arm-kernel mailing list