Re: [PATCH v2 00/17] x86/resctrl : Support AMD Assignable Bandwidth Monitoring Counters (ABMC)

From: Reinette Chatre
Date: Mon Mar 04 2024 - 14:58:34 EST


Hi Babu,

On 3/4/2024 11:34 AM, Moger, Babu wrote:
> On 3/1/2024 5:20 PM, Reinette Chatre wrote:
>> On 3/1/2024 12:36 PM, Moger, Babu wrote:
>>> On 2/29/24 15:50, Reinette Chatre wrote:
>>>> On 2/29/2024 12:37 PM, Moger, Babu wrote:
>>

>>> To assign a counters to default group on domain 0.
>>> $echo "//00=+lt;01=+lt" > /sys/fs/resctrl/info/L3_MON/mbm_assign_control
>> It should not be necessary to use both "=" and "+" in the same assignment.
>> I think of "=" as "assign" and "+" as append ("-" as remove).
> Here are our options.
>
> a. assign one event (+)

I prefer that we use consistent interface with what users may be used to
in other kernel interfaces, like dynamic debug.
Considering that, "+" will not be "assign one event" but instead
(let me copy text from dynamic debug to help):
"+ add the given flags"

So + will add (append) the provided flags to the matching domain, it
can be multiple flags and does not impact existing flags.

>
> b. unassign one event (-)

"- remove the given flags" - it can be multiple flags that should be
removed from domain.

>
> c. assign both (++ may be?)

No. Please do not constrain the interface with what needs to be supported
for ABMC. We may want to add other flags in the future, do not limit it to
two flags.

>
> d. unassign both (_)

"=_" will unassign all flags without consideration of which flags
are set. User can also use "-l" to just unassign local MBM, "-t" to
unassign total MBM, or "-lt" to unassign local and total MBM specifically.

>
> I think append ( "=") is not required while assigning.  It is confusing.

"=" is not append. It is assign:

" = set the flags to the given flags"

>
> Assign or Add both involve same action.
>
> How about this? This might be easy to parse. May be space (" ") after the domain id.

Why a space?

>
> <group>/<domain id> <action><event>; <domain id> <action><event>
>

<control group>/<monitor group/<domain id><action><flags or _>;<domain id><action><flags or _>

Reinette