Re: [PATCH v12 16/26] x86/resctrl: Report 'Unassigned' for MBM events in mbm_cntr_assign mode

Reinette Chatre
2025-04-11T21:09:33Z

Hi Babu,

On 4/3/25 5:18 PM, Babu Moger wrote:
> In mbm_cntr_assign mode, the hardware counter should be assigned to read
> the MBM events.
>
> Report 'Unassigned' in case the user attempts to read the events without

"the events" -> "the event"?

> assigning the counter.

"the counter" -> "a hardware counter"?

>
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> ---
...

> ---
> Documentation/arch/x86/resctrl.rst | 10 ++++++++++
> arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 14 ++++++++++++++
> arch/x86/kernel/cpu/resctrl/internal.h | 3 +++
> arch/x86/kernel/cpu/resctrl/monitor.c | 4 ++--
> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +-
> 5 files changed, 30 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/arch/x86/resctrl.rst b/Documentation/arch/x86/resctrl.rst
> index 44128fbda4fe..71ed1cfed33a 100644
> --- a/Documentation/arch/x86/resctrl.rst
> +++ b/Documentation/arch/x86/resctrl.rst
> @@ -430,6 +430,16 @@ When monitoring is enabled all MON groups will also contain:
> for the L3 cache they occupy). These are named "mon_sub_L3_YY"
> where "YY" is the node number.
>
> + The mbm_cntr_assign mode offers "num_mbm_cntrs" number of counters
> + and allows users to assign a counter to mon_hw_id, event pair enabling
> + bandwidth monitoring for as long as the counter remains assigned.
> + The hardware will continue tracking the assigned mon_hw_id until
> + the user manually unassigns it, ensuring that counters are not reset
> + during this period. System may run out of assignable counters when
> + all the counters are already assigned. In that case, MBM event counters

Counters could be unassigned even if there are assignable counters available.

I think the "System may run ..." sentence should be dropped.
The "In that case ..." sentence could be simplified with something like:
"An MBM event returns 'Unassigned' when the event does not have a hardware
counter assigned."

> + will return 'Unassigned' when the event is read. Users must manually
> + assign a counter to read the events.
> +
> "mon_hw_id":
> Available only with debug option. The identifier used by hardware
> for the monitor group. On x86 this is the RMID.

Reinette