[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f4437f90-6e73-4901-b2e0-6a215ecb4d24@amd.com>
Date: Tue, 22 Jul 2025 14:34:23 -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 25/34] fs/resctrl: Add definitions for MBM event
configuration
Hi Reinette,
On 7/17/25 22:55, Reinette Chatre wrote:
> Hi Babu,
>
> On 7/8/25 3:17 PM, Babu Moger wrote:
>> The "mbm_event" counter assignment mode allows the user to assign a
>> hardware counter to an RMID, event pair and monitor the bandwidth as long
>> as it is assigned. The user can specify the memory transaction(s) for the
>> counter to track.
>>
>> Add the definitions for supported memory transactions (e.g., read, write,
>> etc.) the counter can be configured with.
>>
>> Signed-off-by: Babu Moger <babu.moger@....com>
>> ---
>
> ...
>
>> ---
>> fs/resctrl/internal.h | 11 +++++++++++
>> fs/resctrl/monitor.c | 11 +++++++++++
>> include/linux/resctrl_types.h | 3 +++
>> 3 files changed, 25 insertions(+)
>>
>> diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h
>> index fb4fec4a4cdc..63526400e632 100644
>> --- a/fs/resctrl/internal.h
>> +++ b/fs/resctrl/internal.h
>> @@ -216,6 +216,17 @@ struct rdtgroup {
>> struct pseudo_lock_region *plr;
>> };
>>
>> +/**
>> + * struct mbm_transaction - Memory transaction an MBM event can be configured with.
>> + * @name: Name of memory transaction (read, write ...).
>> + * @val: The bit used to represent the memory transaction within an
>> + * event's configuration.
>
> Please include something similar to the mon_evt::evt_cfg kernel-doc to help reader
> know where bit values come from. For example,
>
> * @val: The bit (eg. READS_TO_LOCAL_MEM or READS_TO_REMOTE_MEM) used to represent
> * the memory transaction within an event's configuration.
>
Sure.
>> + */
>> +struct mbm_transaction {
>> + char name[32];
>> + u32 val;
>> +};
>> +
>> /* rdtgroup.flags */
>> #define RDT_DELETED 1
>>
>> diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
>> index 35faca7ff3b1..1670163649e7 100644
>> --- a/fs/resctrl/monitor.c
>> +++ b/fs/resctrl/monitor.c
>> @@ -920,6 +920,17 @@ u32 resctrl_get_mon_evt_cfg(enum resctrl_event_id evtid)
>> return mon_event_all[evtid].evt_cfg;
>> }
>>
>> +/* Decoded values for each type of memory transactions */
>
> "transactions" -> "transaction."?
>
Sure.
>> +struct mbm_transaction mbm_transactions[NUM_MBM_TRANSACTIONS] = {
>> + {"local_reads", READS_TO_LOCAL_MEM},
>> + {"remote_reads", READS_TO_REMOTE_MEM},
>> + {"local_non_temporal_writes", NON_TEMP_WRITE_TO_LOCAL_MEM},
>> + {"remote_non_temporal_writes", NON_TEMP_WRITE_TO_REMOTE_MEM},
>> + {"local_reads_slow_memory", READS_TO_LOCAL_S_MEM},
>> + {"remote_reads_slow_memory", READS_TO_REMOTE_S_MEM},
>> + {"dirty_victim_writes_all", DIRTY_VICTIMS_TO_ALL_MEM},
>> +};
>> +
>> /**
>> * resctrl_mon_resource_init() - Initialise global monitoring structures.
>> *
>> diff --git a/include/linux/resctrl_types.h b/include/linux/resctrl_types.h
>> index d98351663c2c..acfe07860b34 100644
>> --- a/include/linux/resctrl_types.h
>> +++ b/include/linux/resctrl_types.h
>> @@ -34,6 +34,9 @@
>> /* Max event bits supported */
>> #define MAX_EVT_CONFIG_BITS GENMASK(6, 0)
>>
>> +/* Number of memory transactions that an MBM event can be configured with */
>> +#define NUM_MBM_TRANSACTIONS 7
>> +
>> /* Event IDs */
>> enum resctrl_event_id {
>> /* Must match value of first event below */
>
> Reinette
>
--
Thanks
Babu Moger
Powered by blists - more mailing lists