Skip to content

Commit 141cb5c

Browse files
aeglbp3tk0v
authored andcommitted
x86/resctrl: Make mba_sc use total bandwidth if local is not supported
The default input measurement to the mba_sc feedback loop for memory bandwidth control when the user mounts with the "mba_MBps" option is the local bandwidth event. But some systems may not support a local bandwidth event. When local bandwidth event is not supported, check for support of total bandwidth and use that instead. Relax the mount option check to allow use of the "mba_MBps" option for systems when only total bandwidth monitoring is supported. Also update the error message. Signed-off-by: Tony Luck <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2c272fa commit 141cb5c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,8 @@ static __init bool get_rdt_mon_resources(void)
965965

966966
if (is_mbm_local_enabled())
967967
mba_mbps_default_event = QOS_L3_MBM_LOCAL_EVENT_ID;
968+
else if (is_mbm_total_enabled())
969+
mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID;
968970

969971
return !rdt_get_mon_l3_config(r);
970972
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,7 +2341,7 @@ static bool supports_mba_mbps(void)
23412341
struct rdt_resource *rmbm = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
23422342
struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
23432343

2344-
return (is_mbm_local_enabled() &&
2344+
return (is_mbm_enabled() &&
23452345
r->alloc_capable && is_mba_linear() &&
23462346
r->ctrl_scope == rmbm->mon_scope);
23472347
}
@@ -2768,7 +2768,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param)
27682768
ctx->enable_cdpl2 = true;
27692769
return 0;
27702770
case Opt_mba_mbps:
2771-
msg = "mba_MBps requires local MBM and linear scale MBA at L3 scope";
2771+
msg = "mba_MBps requires MBM and linear scale MBA at L3 scope";
27722772
if (!supports_mba_mbps())
27732773
return invalfc(fc, msg);
27742774
ctx->enable_mba_mbps = true;

0 commit comments

Comments
 (0)