Skip to content

Commit ac20aa4

Browse files
aeglbp3tk0v
authored andcommitted
x86/resctrl: Block use of mba_MBps mount option on Sub-NUMA Cluster (SNC) systems
When SNC is enabled there is a mismatch between the MBA control function which operates at L3 cache scope and the MBM monitor functions which measure memory bandwidth on each SNC node. Block use of the mba_MBps when scopes for MBA/MBM do not match. Improve user diagnostics by adding invalfc() message when mba_MBps is not supported. 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 e13db55 commit ac20aa4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,14 +2335,18 @@ static void mba_sc_domain_destroy(struct rdt_resource *r,
23352335

23362336
/*
23372337
* MBA software controller is supported only if
2338-
* MBM is supported and MBA is in linear scale.
2338+
* MBM is supported and MBA is in linear scale,
2339+
* and the MBM monitor scope is the same as MBA
2340+
* control scope.
23392341
*/
23402342
static bool supports_mba_mbps(void)
23412343
{
2344+
struct rdt_resource *rmbm = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
23422345
struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
23432346

23442347
return (is_mbm_local_enabled() &&
2345-
r->alloc_capable && is_mba_linear());
2348+
r->alloc_capable && is_mba_linear() &&
2349+
r->ctrl_scope == rmbm->mon_scope);
23462350
}
23472351

23482352
/*
@@ -2750,6 +2754,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param)
27502754
{
27512755
struct rdt_fs_context *ctx = rdt_fc2context(fc);
27522756
struct fs_parse_result result;
2757+
const char *msg;
27532758
int opt;
27542759

27552760
opt = fs_parse(fc, rdt_fs_parameters, param, &result);
@@ -2764,8 +2769,9 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param)
27642769
ctx->enable_cdpl2 = true;
27652770
return 0;
27662771
case Opt_mba_mbps:
2772+
msg = "mba_MBps requires local MBM and linear scale MBA at L3 scope";
27672773
if (!supports_mba_mbps())
2768-
return -EINVAL;
2774+
return invalfc(fc, msg);
27692775
ctx->enable_mba_mbps = true;
27702776
return 0;
27712777
case Opt_debug:

0 commit comments

Comments
 (0)