[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48df72bd-edcd-483f-8ad6-318a40b07f08@intel.com>
Date: Thu, 17 Jul 2025 20:55:49 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: Babu Moger <babu.moger@....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 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.
> + */
> +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."?
> +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
Powered by blists - more mailing lists