Skip to content

Commit 37bae17

Browse files
James Morsebp3tk0v
authored andcommitted
x86/resctrl: Move mba_mbps_default_event init to filesystem code
mba_mbps_default_event is initialised based on whether mbm_local or mbm_total is supported. In the case of both, it is initialised to mbm_local. mba_mbps_default_event is initialised in core.c's get_rdt_mon_resources(), while all the readers are in rdtgroup.c. After this code is split into architecture-specific and filesystem code, get_rdt_mon_resources() remains part of the architecture code, which would mean mba_mbps_default_event has to be exposed by the filesystem code. Move the initialisation to the filesystem's resctrl_mon_resource_init(). Signed-off-by: James Morse <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Reviewed-by: Babu Moger <[email protected]> Reviewed-by: Shaopeng Tan <[email protected]> Tested-by: Peter Newman <[email protected]> Tested-by: Shaopeng Tan <[email protected]> Tested-by: Amit Singh Tomar <[email protected]> # arm64 Tested-by: Shanker Donthineni <[email protected]> # arm64 Tested-by: Babu Moger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 650680d commit 37bae17

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,6 @@ static __init bool get_rdt_mon_resources(void)
923923
if (!rdt_mon_features)
924924
return false;
925925

926-
if (resctrl_arch_is_mbm_local_enabled())
927-
mba_mbps_default_event = QOS_L3_MBM_LOCAL_EVENT_ID;
928-
else if (resctrl_arch_is_mbm_total_enabled())
929-
mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID;
930-
931926
return !rdt_get_mon_l3_config(r);
932927
}
933928

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,11 @@ int __init resctrl_mon_resource_init(void)
12131213
RFTYPE_MON_INFO | RFTYPE_RES_CACHE);
12141214
}
12151215

1216+
if (resctrl_arch_is_mbm_local_enabled())
1217+
mba_mbps_default_event = QOS_L3_MBM_LOCAL_EVENT_ID;
1218+
else if (resctrl_arch_is_mbm_total_enabled())
1219+
mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID;
1220+
12161221
return 0;
12171222
}
12181223

0 commit comments

Comments
 (0)