RE: [PATCH v8 08/25] x86/resctrl: Introduce interface to display number of monitoring counters

From: Luck, Tony
Date: Thu Oct 10 2024 - 11:59:02 EST


> All good points. How about this text:
>
> "num_mbm_cntrs":
> The number of monitoring counters available for assignment when the
> architecture supports mbm_cntr_assign mode.
>
> Resctrl subsystem provides the interface to count maximum of two memory
> bandwidth events per group, from a combination of available total and
> local events. Keeping the current interface, users can enable a maximum of
> 2 counters per group. User will also have the option to enable only one
> counter to the group to maximize the number of groups monitored.

Much better. Looks OK to me.

New questions:

1) Should resctrl provide a file to tell the user how many free
counters are available? They can figure it out by counting all the 'l' and 't'
in "mbm_assign_control" and subtracting that from "num_mbm_cntrs".
But that seems complex.

2) Even more so because free counters might be different per socket
if the user did some "0=tl;1=_" assignments as in one of your examples.

Maybe a UI like:

$ cat /sys/fs/resctrl/info/L3_MON/free_mbm_cntrs
0=5;1=9

-Tony