[RFC PATCH v2 6/9] fs/resctrl: Reject mba_MBps when the maximum is only a soft limit
From: Jinjie Ruan
Date: Thu Nov 12 2026 - 08:43:51 EST
The controller lowers the maximum bandwidth control when the measured
bandwidth exceeds the target, and relies on the hardware enforcing
that maximum. A hard limit does not service requests above the
maximum; a soft limit services them when no other request is waiting,
so a group without competing traffic keeps exceeding the target and
the controller never converges.
Add resctrl_membw::max_is_soft_limit for architectures whose maximum
control implements only the soft limit, and refuse to mount with
mba_MBps when it is set. Architectures that leave the flag clear are
unchanged.
Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
---
fs/resctrl/rdtgroup.c | 5 ++++-
include/linux/resctrl.h | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 518d89b0c67d..9f10b6ceff8a 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2613,6 +2613,8 @@ static void mba_sc_domain_destroy(struct rdt_resource *r,
* The controller needs a counter for its event in every monitoring group.
* With assignable counters that requires a fixed assignment mode, with
* counters assigned automatically while the controller is in use.
+ *
+ * The maximum control must also be a hard limit, see max_is_soft_limit.
*/
static bool supports_mba_mbps(void)
{
@@ -2622,6 +2624,7 @@ static bool supports_mba_mbps(void)
return (resctrl_is_mbm_enabled() &&
r->alloc_capable && is_mba_linear() &&
r->ctrl_scope == rmbm->mon_scope &&
+ !r->membw.max_is_soft_limit &&
(!rmbm->mon.mbm_cntr_assignable ||
rmbm->mon.mbm_cntr_assign_fixed));
}
@@ -3370,7 +3373,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, linear scale MBA at L3 scope and an enforced maximum";
if (!supports_mba_mbps())
return invalfc(fc, msg);
ctx->enable_mba_mbps = true;
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 10dfdca7f4bf..933bab2b8289 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -250,6 +250,7 @@ enum membw_throttle_mode {
* @bw_gran: Granularity at which the memory bandwidth is allocated
* @delay_linear: True if memory B/W delay is in linear scale
* @arch_needs_linear: True if we can't configure non-linear resources
+ * @max_is_soft_limit: True if maximum control only marks traffic as low priority
* @throttle_mode: Bandwidth throttling mode when threads request
* different memory bandwidths
* @mba_sc: True if MBA software controller(mba_sc) is enabled
@@ -261,6 +262,7 @@ struct resctrl_membw {
u32 bw_gran;
u32 delay_linear;
bool arch_needs_linear;
+ bool max_is_soft_limit;
enum membw_throttle_mode throttle_mode;
bool mba_sc;
u32 *mb_map;
--
2.34.1