lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <82b8e6fb-8663-42b7-b67c-43e4ea6f8aa8@amd.com>
Date: Wed, 23 Jul 2025 13:50:03 -0500
From: "Moger, Babu" <babu.moger@....com>
To: Reinette Chatre <reinette.chatre@...el.com>, corbet@....net,
 tony.luck@...el.com, james.morse@....com, tglx@...utronix.de,
 mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com
Cc: Dave.Martin@....com, x86@...nel.org, hpa@...or.com,
 akpm@...ux-foundation.org, paulmck@...nel.org, rostedt@...dmis.org,
 Neeraj.Upadhyay@....com, david@...hat.com, arnd@...db.de, fvdl@...gle.com,
 seanjc@...gle.com, jpoimboe@...nel.org, pawan.kumar.gupta@...ux.intel.com,
 xin@...or.com, manali.shukla@....com, tao1.su@...ux.intel.com,
 sohil.mehta@...el.com, kai.huang@...el.com, xiaoyao.li@...el.com,
 peterz@...radead.org, xin3.li@...el.com, kan.liang@...ux.intel.com,
 mario.limonciello@....com, thomas.lendacky@....com, perry.yuan@....com,
 gautham.shenoy@....com, chang.seok.bae@...el.com, linux-doc@...r.kernel.org,
 linux-kernel@...r.kernel.org, peternewman@...gle.com, eranian@...gle.com
Subject: Re: [PATCH v15 33/34] fs/resctrl: Introduce the interface to switch
 between monitor modes

Hi Reinette,

On 7/17/25 23:03, Reinette Chatre wrote:
> Hi Babu,
> 
> On 7/8/25 3:17 PM, Babu Moger wrote:
>> Resctrl subsystem can support two monitoring modes, "mbm_event" or
>> "default". In mbm_event mode, monitoring event can only accumulate data
>> while it is backed by a hardware counter. In "default" mode, resctrl
>> assumes there is a hardware counter for each event within every CTRL_MON
>> and MON group.
>>
>> Introduce mbm_assign_mode resctrl file to switch between mbm_event and
>> default modes.
>>
>> Example:
>> To list the MBM monitor modes supported:
>> $ cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>> [mbm_event]
>> default
>>
>> To enable the "mbm_event" monitoring mode:
> 
> "monitoring mode" -> "counter assignment mode"?

Sure.

> 
>> $ echo "mbm_event" > /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>>
>> To enable the "default" monitoring mode:
>> $ echo "default" > /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>>
>> MBM event counters are automatically reset as part of changing the mode.
>> Clear both architectural and non-architectural event states to prevent
>> overflow conditions during the next event read. Also clear assignable
>> counter configuration on all the domains.
>>
>> Signed-off-by: Babu Moger <babu.moger@....com>
>> ---
> 
> ...
> 
>> ---
>>  Documentation/filesystems/resctrl.rst | 22 +++++++-
>>  fs/resctrl/internal.h                 |  2 +
>>  fs/resctrl/monitor.c                  | 27 ++++++++++
>>  fs/resctrl/rdtgroup.c                 | 72 ++++++++++++++++++++++++++-
>>  4 files changed, 121 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesystems/resctrl.rst
>> index 2b2acb55d8b1..b8a4dbe061ea 100644
>> --- a/Documentation/filesystems/resctrl.rst
>> +++ b/Documentation/filesystems/resctrl.rst
>> @@ -259,7 +259,8 @@ with the following files:
>>  
>>  "mbm_assign_mode":
>>  	The supported counter assignment modes. The enclosed brackets indicate which mode
>> -	is enabled.
>> +	is enabled. The MBM events associated with counters may reset when "mbm_assign_mode"
>> +	is changed.
>>  	::
>>  
>>  	  # cat /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>> @@ -279,6 +280,15 @@ with the following files:
>>  	of counters available is described in the "num_mbm_cntrs" file. Changing the
>>  	mode may cause all counters on the resource to reset.
>>  
>> +	Moving to mbm_event counter assignment mode requires users to assign the counters
>> +	to the events. Otherwise, the MBM event counters will return 'Unassigned' when read.
>> +
>> +	The mode is beneficial for AMD platforms that support more CTRL_MON
>> +	and MON groups than available hardware counters. By default, this
>> +	feature is enabled on AMD platforms with the ABMC (Assignable Bandwidth
>> +	Monitoring Counters) capability, ensuring counters remain assigned even
>> +	when the corresponding RMID is not actively used by any processor.
>> +
>>  	"default":
>>  
>>  	In default mode, resctrl assumes there is a hardware counter for each
>> @@ -288,6 +298,16 @@ with the following files:
>>  	result in misleading values or display "Unavailable" if no counter is assigned
>>  	to the event.
>>  
>> +	* To enable "mbm_event" monitoring mode:
> 
> "monitoring mode" -> "counter assignment mode"?
> 

Sure.

>> +	  ::
>> +
>> +	    # echo "mbm_event" > /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>> +
>> +	* To enable "default" monitoring mode:
>> +	  ::
>> +
>> +	    # echo "default" > /sys/fs/resctrl/info/L3_MON/mbm_assign_mode
>> +
>>  "num_mbm_cntrs":
>>  	The maximum number of counters (total of available and assigned counters) in
>>  	each domain when the system supports mbm_event mode.
> 
> Reinette
> 
> 

-- 
Thanks
Babu Moger

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ