[PATCH v6 28/40] arm_mpam: resctrl: Add support for csu counters

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


On 3/14/26 12:46 AM, Ben Horgan wrote:
> From: James Morse <james.morse at arm.com>
> 
> resctrl exposes a counter via a file named llc_occupancy. This isn't really
> a counter as its value goes up and down, this is a snapshot of the cache
> storage usage monitor.
> 
> Add some picking code which will only find an L3. The resctrl counter
> file is called llc_occupancy but we don't check it is the last one as
> it is already identified as L3.
> 
> Tested-by: Shaopeng Tan <tan.shaopeng at jp.fujitsu.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>
> Co-developed-by: Dave Martin <dave.martin at arm.com>
> Signed-off-by: Dave Martin <dave.martin at arm.com>
> Signed-off-by: Ben Horgan <ben.horgan at arm.com>
> ---
> Changes since rfc:
> Allow csu counters however many partid or pmg there are
> else if -> if
> reduce scope of local variables
> drop has_csu
> 
> Changes since v2:
> return -> break so works for mbwu in later patch
> add for_each_mpam_resctrl_mon
> return error from mpam_resctrl_monitor_init(). It may fail when is abmc
> allocation introduced in a later patch.
> Squashed in patch from Dave Martin:
> https://lore.kernel.org/lkml/20250820131621.54983-1-Dave.Martin@arm.com/
> 
> Changes since v3:
> resctrl_enable_mon_event() signature update
> Restrict the events considered
> num-rmid update
> Use raw_smp_processor_id()
> Tighten heuristics:
>   Make sure it is the L3
>   Please shout if this means the counters aren't exposed on any platforms
> Drop tags due to change in policy/rework
> 
> Changes since v4:
> Move generic monitor boilerplate to separate patch
> ---
>   drivers/resctrl/mpam_resctrl.c | 83 ++++++++++++++++++++++++++++++++++
>   1 file changed, 83 insertions(+)
> 
Reviewed-by: Gavin Shan <gshan at redhat.com>




More information about the linux-arm-kernel mailing list