Re: [PATCH v5 1/5] arm_mpam: resctrl: Pick classes for use as MBM counters

From: Gavin Shan

Date: Wed Jul 15 2026 - 06:14:23 EST


On 7/8/26 2:24 AM, Ben Horgan wrote:
From: James Morse <james.morse@xxxxxxx>

resctrl has two types of bandwidth counters, NUMA-local and global. MPAM
can only count globally; either using MSC at the L3 cache or in the memory
controllers. When global and local equate to the same thing continue just
to call it global.

Pick the corresponding MPAM classes to back the MBM counters. As resctrl
requires all monitors to be at the L3 cache, we can only use the counters
at the memory controllers when they have the same topology as the L3 cache
and the traffic they see if the same. In particular, for the bandwidth
counters at the memory controllers to be exposed to resctrl it is required
there is a single L3 cache and a single NUMA node as otherwise cross NUMA
traffic will be counted at the wrong instance.

Signed-off-by: James Morse <james.morse@xxxxxxx>
Signed-off-by: Ben Horgan <ben.horgan@xxxxxxx>
Tested-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
Tested-by: Zeng Heng <zengheng4@xxxxxxxxxx>
Tested-by: Fenghua Yu <fenghuay@xxxxxxxxxx>
Reviewed-by: Shaopeng Tan <tan.shaopeng@xxxxxxxxxxxxxx>
Reviewed-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>
Reviewed-by: Fenghua Yu <fenghuay@xxxxxxxxxx>
---
Changes since rfc v1:
Move finding any_mon_comp into monitor boilerplate patch
Move mpam_resctrl_get_domain_from_cpu() into monitor boilerplate
Remove free running check
Trim commit message

Changes since v3:
Extra paragraph in commit message

Changes since v4:
Commit message tag ordering
New sentence in block comment (Fenghua)
---
drivers/resctrl/mpam_resctrl.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)


Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>