Re: [PATCH v5 3/7] fs/resctrl: Disallow the software controller when MBM counters are assignable
From: Reinette Chatre
Date: Mon May 04 2026 - 12:04:08 EST
Hi Ben,
On 4/28/26 6:04 AM, Ben Horgan wrote:
> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
> index b382a348dd79..be84bb210e3a 100644
> --- a/fs/resctrl/rdtgroup.c
> +++ b/fs/resctrl/rdtgroup.c
> @@ -2530,7 +2530,8 @@ static bool supports_mba_mbps(void)
>
> return (resctrl_is_mbm_enabled() &&
> r->alloc_capable && is_mba_linear() &&
> - r->ctrl_scope == rmbm->mon_scope);
> + r->ctrl_scope == rmbm->mon_scope &&
> + !rmbm->mon.mbm_cntr_assignable);
> }
For better or worse supports_mba_mbps() has a function description that documents
the above tests. Updating the tests but not the accompanying description creates
an inconsistency. How about something like below?
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 36d21652616e..b456a67b2c24 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2536,10 +2536,12 @@ static void mba_sc_domain_destroy(struct rdt_resource *r,
}
/*
- * MBA software controller is supported only if
- * MBM is supported and MBA is in linear scale,
- * and the MBM monitor scope is the same as MBA
- * control scope.
+ * MBA software controller is supported only if MBM is supported and MBA is in
+ * linear scale, and the MBM monitor scope is the same as MBA control scope.
+ *
+ * Software controller cannot be supported when the MBM counters are assignable.
+ * There is no guarantee that MBM counters are assigned to the event backing
+ * the software controller in all monitoring domains of all monitoring groups.
*/
static bool supports_mba_mbps(void)
{
>
> /*
> @@ -2945,7 +2946,7 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param)
> ctx->enable_cdpl2 = true;
> return 0;
> case Opt_mba_mbps:
> - msg = "mba_MBps requires MBM and linear scale MBA at L3 scope";
> + msg = "mba_MBps requires MBM (mbm_event mode not supported) and linear scale MBA at L3 scope";
> if (!supports_mba_mbps())
> return invalfc(fc, msg);
> ctx->enable_mba_mbps = true;
Reinette