[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <102328ce-39fe-44a0-884a-1ba74c4bbaef@amd.com>
Date: Wed, 25 Jun 2025 15:14:41 -0500
From: "Moger, Babu" <babu.moger@....com>
To: Reinette Chatre <reinette.chatre@...el.com>, corbet@....net,
tony.luck@...el.com, Dave.Martin@....com, james.morse@....com,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com
Cc: x86@...nel.org, hpa@...or.com, akpm@...ux-foundation.org,
rostedt@...dmis.org, paulmck@...nel.org, thuth@...hat.com, ardb@...nel.org,
gregkh@...uxfoundation.org, seanjc@...gle.com, thomas.lendacky@....com,
pawan.kumar.gupta@...ux.intel.com, manali.shukla@....com,
perry.yuan@....com, kai.huang@...el.com, peterz@...radead.org,
xiaoyao.li@...el.com, kan.liang@...ux.intel.com, mario.limonciello@....com,
xin3.li@...el.com, gautham.shenoy@....com, xin@...or.com,
chang.seok.bae@...el.com, fenghuay@...dia.com, peternewman@...gle.com,
maciej.wieczor-retman@...el.com, eranian@...gle.com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v14 11/32] fs/resctrl: Introduce the interface to display
monitoring modes
Hi Reinette,
On 6/24/25 17:47, Reinette Chatre wrote:
> Hi Babu,
>
> On 6/13/25 2:04 PM, Babu Moger wrote:
>> Introduce the resctrl file "mbm_assign_mode" to list the supported
>> monitoring modes.
>
> "the supported monitoring modes" -> "the supported counter assignment modes"?
Sure.
>
>>
>> The "mbm_event" mode allows users to assign a hardware counter ID to an
>
> nit: users do not assign/pick the ID, this is done by resctrl. So perhaps
> just "users to assign a hardware counter to ..."
Sure.
>
>> RMID, event pair and monitor bandwidth usage as long as it is assigned.
>> The hardware continues to track the assigned counter until it is
>> explicitly unassigned by the user. Each event within a resctrl group
>> can be assigned independently in this mode.
>>
>> On AMD systems "mbm_event" mode is backed by the ABMC (Assignable
>> Bandwidth Monitoring Counters) hardware feature and is enabled by default.
>>
>> The "default" mode is the existing mode that works without the explicit
>> counter assignment, instead relying on dynamic counter assignment by
>> hardware that may result in hardware not dedicating a counter resulting
>> in monitoring data reads returning "Unavailable".
>>
>> Provide an interface to display the monitor modes on the system.
>>
>> $ cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>> [mbm_event]
>> default
>>
>> Add IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED) check to support Arm64.
>>
>> On x86, CONFIG_RESCTRL_ASSIGN_FIXED is not defined. On Arm64, it will be
>> defined when the "mbm_event" mode is supported.
>>
>> Add IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED) check early to ensure the user
>> interface remains compatible with upcoming Arm64 support. IS_ENABLED()
>> safely evaluates to 0 when the configuration is not defined.
>>
>> As a result, for MPAM, the display would be either:
>> [default]
>> or
>> [mbm_event]
>>
>> Signed-off-by: Babu Moger <babu.moger@....com>
>> ---
>
> ...
>
>> ---
>> Documentation/filesystems/resctrl.rst | 31 ++++++++++++++++++++++
>> fs/resctrl/rdtgroup.c | 37 +++++++++++++++++++++++++++
>> 2 files changed, 68 insertions(+)
>>
>> diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesystems/resctrl.rst
>> index c97fd77a107d..4e76e4ac5d3a 100644
>> --- a/Documentation/filesystems/resctrl.rst
>> +++ b/Documentation/filesystems/resctrl.rst
>> @@ -257,6 +257,37 @@ with the following files:
>> # cat /sys/fs/resctrl/info/L3_MON/mbm_local_bytes_config
>> 0=0x30;1=0x30;3=0x15;4=0x15
>>
>> +"mbm_assign_mode":
>> + The supported monitoring modes. The enclosed brackets indicate which mode
>
> "The supported monitoring modes." -> "The supported counter assignment modes."?
>
Sure.
>> + is enabled.
>> + ::
>> +
>> + # cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>> + [mbm_event]
>> + default
>> +
>> + "mbm_event":
>> +
>> + mbm_event mode allows users to assign a hardware counter ID to an RMID, event
>
> "hardware counter ID" -> "hardware counter"
>
Sure.
>> + pair and monitor the bandwidth usage as long as it is assigned. The hardware
>> + continues to track the assigned counter until it is explicitly unassigned by
>> + the user. Each event within a resctrl group can be assigned independently.
>> +
>> + In this mode, a monitoring event can only accumulate data while it is backed
>> + by a hardware counter. Use "mbm_L3_assignments" found in each CTRL_MON and MON
>> + group to specify which of the events should have a counter assigned. The number
>> + of counters available is described in the "num_mbm_cntrs" file. Changing the
>> + mode may cause all counters on the resource to reset.
>> +
>> + "default":
>> +
>> + In default mode, resctrl assumes there is a hardware counter for each
>> + event within every CTRL_MON and MON group. On AMD platforms, it is
>> + recommended to use the mbm_event mode, if supported, to prevent reset of MBM
>> + events between reads resulting from hardware re-allocating counters. This can
>> + result in misleading values or display "Unavailable" if no counter is assigned
>> + to the event.
>> +
>> "max_threshold_occupancy":
>> Read/write file provides the largest value (in
>> bytes) at which a previously used LLC_occupancy
>
> Reinette
>
>
--
Thanks
Babu Moger
Powered by blists - more mailing lists