[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8e9f18e1bba578d74fc3e3cb887c5101eb73e1d7.1747349530.git.babu.moger@amd.com>
Date: Thu, 15 May 2025 17:52:03 -0500
From: Babu Moger <babu.moger@....com>
To: <corbet@....net>, <tony.luck@...el.com>, <reinette.chatre@...el.com>,
<tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>
CC: <james.morse@....com>, <dave.martin@....com>, <fenghuay@...dia.com>,
<x86@...nel.org>, <hpa@...or.com>, <paulmck@...nel.org>,
<akpm@...ux-foundation.org>, <thuth@...hat.com>, <rostedt@...dmis.org>,
<ardb@...nel.org>, <gregkh@...uxfoundation.org>,
<daniel.sneddon@...ux.intel.com>, <jpoimboe@...nel.org>,
<alexandre.chartre@...cle.com>, <pawan.kumar.gupta@...ux.intel.com>,
<thomas.lendacky@....com>, <perry.yuan@....com>, <seanjc@...gle.com>,
<kai.huang@...el.com>, <xiaoyao.li@...el.com>, <babu.moger@....com>,
<kan.liang@...ux.intel.com>, <xin3.li@...el.com>, <ebiggers@...gle.com>,
<xin@...or.com>, <sohil.mehta@...el.com>, <andrew.cooper3@...rix.com>,
<mario.limonciello@....com>, <linux-doc@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <peternewman@...gle.com>,
<maciej.wieczor-retman@...el.com>, <eranian@...gle.com>,
<Xiaojian.Du@....com>, <gautham.shenoy@....com>
Subject: [PATCH v13 18/27] x86/resctrl: Add definitions for MBM event configuration
The "mbm_cntr_assign" mode allows users to manually assign a hardware
counter to a specific RMID and event pair. The events available for
assignment are configurable.
By default, each resctrl group supports two MBM events: mbm_total_bytes
and mbm_local_bytes. Each event corresponds to an MBM configuration that
specifies the bandwidth sources tracked by the event.
Add definitions of supported bandwidth sources.
Signed-off-by: Babu Moger <babu.moger@....com>
---
v13: Updated the changelog.
Removed the definitions from resctrl_types.h and moved to internal.h.
Removed mbm_assign_config definition. Configurations will be part of
mon_evt list.
Resolved conflicts caused by the recent FS/ARCH code restructure.
The rdtgroup.c file has now been split between the FS and ARCH directories.
v12: New patch to support event configurations via new counter_configs
method.
---
fs/resctrl/internal.h | 10 ++++++++++
fs/resctrl/rdtgroup.c | 14 ++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h
index 0dfd2efe68fc..019d00bf5adf 100644
--- a/fs/resctrl/internal.h
+++ b/fs/resctrl/internal.h
@@ -203,6 +203,16 @@ struct rdtgroup {
struct pseudo_lock_region *plr;
};
+/**
+ * struct mbm_evt_value - Specific type of memory events.
+ * @evt_name: Name of memory transaction type (read, write etc).
+ * @evt_val: Value representing the memory transaction.
+ */
+struct mbm_evt_value {
+ char evt_name[32];
+ u32 evt_val;
+};
+
/* rdtgroup.flags */
#define RDT_DELETED 1
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 72317a5adee2..b109e91096b0 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -75,6 +75,20 @@ static void rdtgroup_destroy_root(void);
struct dentry *debugfs_resctrl;
+/* Number of memory transaction types that can be monitored */
+#define NUM_MBM_EVT_VALUES 7
+
+/* Decoded values for each type of memory events */
+struct mbm_evt_value mbm_evt_values[NUM_MBM_EVT_VALUES] = {
+ {"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},
+};
+
/*
* Memory bandwidth monitoring event to use for the default CTRL_MON group
* and each new CTRL_MON group created by the user. Only relevant when
--
2.34.1
Powered by blists - more mailing lists