Skip to content

Commit 73afb2d

Browse files
babumogerbp3tk0v
authored andcommitted
x86/resctrl: Add interface to read mbm_local_bytes_config
The event configuration can be viewed by the user by reading the configuration file /sys/fs/resctrl/info/L3_MON/mbm_local_bytes_config. The event configuration settings are domain specific and will affect all the CPUs in the domain. Following are the types of events supported: ==== =========================================================== Bits Description ==== =========================================================== 6 Dirty Victims from the QOS domain to all types of memory 5 Reads to slow memory in the non-local NUMA domain 4 Reads to slow memory in the local NUMA domain 3 Non-temporal writes to non-local NUMA domain 2 Non-temporal writes to local NUMA domain 1 Reads to memory in the non-local NUMA domain 0 Reads to memory in the local NUMA domain ==== =========================================================== By default, the mbm_local_bytes_config is set to 0x15 to count all the local event types. For example: $cat /sys/fs/resctrl/info/L3_MON/mbm_local_bytes_config 0=0x15;1=0x15;2=0x15;3=0x15 In this case, the event mbm_local_bytes is configured with 0x15 on domains 0 to 3. Signed-off-by: Babu Moger <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent dc2a3e8 commit 73afb2d

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

arch/x86/kernel/cpu/resctrl/monitor.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,10 @@ int __init rdt_get_mon_l3_config(struct rdt_resource *r)
805805
mbm_total_event.configurable = true;
806806
mbm_config_rftype_init("mbm_total_bytes_config");
807807
}
808-
if (rdt_cpu_has(X86_FEATURE_CQM_MBM_LOCAL))
808+
if (rdt_cpu_has(X86_FEATURE_CQM_MBM_LOCAL)) {
809809
mbm_local_event.configurable = true;
810+
mbm_config_rftype_init("mbm_local_bytes_config");
811+
}
810812
}
811813

812814
l3_mon_evt_init(r);

arch/x86/kernel/cpu/resctrl/rdtgroup.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,16 @@ static int mbm_total_bytes_config_show(struct kernfs_open_file *of,
15071507
return 0;
15081508
}
15091509

1510+
static int mbm_local_bytes_config_show(struct kernfs_open_file *of,
1511+
struct seq_file *seq, void *v)
1512+
{
1513+
struct rdt_resource *r = of->kn->parent->priv;
1514+
1515+
mbm_config_show(seq, r, QOS_L3_MBM_LOCAL_EVENT_ID);
1516+
1517+
return 0;
1518+
}
1519+
15101520
/* rdtgroup information files for one cache resource. */
15111521
static struct rftype res_common_files[] = {
15121522
{
@@ -1611,6 +1621,12 @@ static struct rftype res_common_files[] = {
16111621
.kf_ops = &rdtgroup_kf_single_ops,
16121622
.seq_show = mbm_total_bytes_config_show,
16131623
},
1624+
{
1625+
.name = "mbm_local_bytes_config",
1626+
.mode = 0444,
1627+
.kf_ops = &rdtgroup_kf_single_ops,
1628+
.seq_show = mbm_local_bytes_config_show,
1629+
},
16141630
{
16151631
.name = "cpus",
16161632
.mode = 0644,

0 commit comments

Comments
 (0)