[PATCH 08/12] fs/resctrl: Reject mba_MBps when the maximum is only a soft limit

Jinjie Ruan ruanjinjie at huawei.com
Sun Nov 29 19:24:43 PST 2026


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. MPAM reports the implemented behavior
in MPAMF_MBW_IDR.MAX_LIM.

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 at huawei.com>
---
 fs/resctrl/rdtgroup.c   | 5 ++++-
 include/linux/resctrl.h | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index b32831871f70..ac674f830c58 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2614,6 +2614,8 @@ static void mba_sc_domain_destroy(struct rdt_resource *r,
  * 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.
+ *
+ * The maximum control must also be a hard limit, see max_is_soft_limit.
  */
 static bool supports_mba_mbps(void)
 {
@@ -2623,6 +2625,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);
 }
 
@@ -3352,7 +3355,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 (mbm_event mode not supported) 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..21dee5703146 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -250,6 +250,8 @@ 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 requests above the maximum are only serviced
+ *			when no other request is waiting
  * @throttle_mode:	Bandwidth throttling mode when threads request
  *			different memory bandwidths
  * @mba_sc:		True if MBA software controller(mba_sc) is enabled
@@ -261,6 +263,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




More information about the linux-arm-kernel mailing list