Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/resctrl: Introduce event configuration field in struct mon_evt

When supported, mbm_event counter assignment mode allows the user to configure
events to track specific types of memory transactions.

Introduce an evt_cfg field in struct mon_evt to define the type of memory
transactions tracked by a monitoring event. Also add a helper function to get
the evt_cfg value.

Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/cover.1757108044.git.babu.moger@amd.com

authored by

Babu Moger and committed by
Borislav Petkov (AMD)
ebebda85 84ecefb7

+17
+5
fs/resctrl/internal.h
··· 56 56 * @evtid: event id 57 57 * @rid: resource id for this event 58 58 * @name: name of the event 59 + * @evt_cfg: Event configuration value that represents the 60 + * memory transactions (e.g., READS_TO_LOCAL_MEM, 61 + * READS_TO_REMOTE_MEM) being tracked by @evtid. 62 + * Only valid if @evtid is an MBM event. 59 63 * @configurable: true if the event is configurable 60 64 * @enabled: true if the event is enabled 61 65 */ ··· 67 63 enum resctrl_event_id evtid; 68 64 enum resctrl_res_level rid; 69 65 char *name; 66 + u32 evt_cfg; 70 67 bool configurable; 71 68 bool enabled; 72 69 };
+10
fs/resctrl/monitor.c
··· 882 882 mon_event_all[eventid].enabled; 883 883 } 884 884 885 + u32 resctrl_get_mon_evt_cfg(enum resctrl_event_id evtid) 886 + { 887 + return mon_event_all[evtid].evt_cfg; 888 + } 889 + 885 890 int resctrl_mbm_assign_mode_show(struct kernfs_open_file *of, 886 891 struct seq_file *s, void *v) 887 892 { ··· 1028 1023 resctrl_enable_mon_event(QOS_L3_MBM_TOTAL_EVENT_ID); 1029 1024 if (!resctrl_is_mon_event_enabled(QOS_L3_MBM_LOCAL_EVENT_ID)) 1030 1025 resctrl_enable_mon_event(QOS_L3_MBM_LOCAL_EVENT_ID); 1026 + mon_event_all[QOS_L3_MBM_TOTAL_EVENT_ID].evt_cfg = r->mon.mbm_cfg_mask; 1027 + mon_event_all[QOS_L3_MBM_LOCAL_EVENT_ID].evt_cfg = r->mon.mbm_cfg_mask & 1028 + (READS_TO_LOCAL_MEM | 1029 + READS_TO_LOCAL_S_MEM | 1030 + NON_TEMP_WRITE_TO_LOCAL_MEM); 1031 1031 resctrl_file_fflags_init("num_mbm_cntrs", 1032 1032 RFTYPE_MON_INFO | RFTYPE_RES_CACHE); 1033 1033 resctrl_file_fflags_init("available_mbm_cntrs",
+2
include/linux/resctrl.h
··· 409 409 eventid <= QOS_L3_MBM_LOCAL_EVENT_ID); 410 410 } 411 411 412 + u32 resctrl_get_mon_evt_cfg(enum resctrl_event_id eventid); 413 + 412 414 /* Iterate over all memory bandwidth events */ 413 415 #define for_each_mbm_event_id(eventid) \ 414 416 for (eventid = QOS_L3_MBM_TOTAL_EVENT_ID; \