[PATCH v3 4/5] fs/resctrl: Drop unnecessary is_mba_linear() helper
From: Reinette Chatre
Date: Wed Nov 04 2026 - 20:59:38 EST
is_mba_linear() assumes it operates on the MBA resource and returns whether
the resource's delay values are linear. There is only one caller that
separately makes the same assumption.
Avoid duplicating the resource assumptions and let the only caller access
the needed property directly.
Signed-off-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
Reviewed-by: Chen Yu <yu.c.chen@xxxxxxxxx>
Reviewed-by: Ben Horgan <ben.horgan@xxxxxxx>
Reviewed-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
Reviewed-by: Tony Luck <tony.luck@xxxxxxxxx>
---
Changes from RFC v1:
- RFC v1 made bandwidth delay a resource property. That change was dropped
and this cleanup is all that remained.
Changes since v1:
- Add Chenyu and Ben's Reviewed-by tags.
- Clarify "resource is linear" vs. "resource's delay values are linear".
Changes since v2:
- Add Jinjie and Tony's Reviewed-by tags.
---
fs/resctrl/rdtgroup.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 57ab090072c2..443b41a4d467 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2577,11 +2577,6 @@ mongroup_create_dir(struct kernfs_node *parent_kn, struct rdtgroup *prgrp,
return ret;
}
-static inline bool is_mba_linear(void)
-{
- return resctrl_arch_get_resource(RDT_RESOURCE_MBA)->membw.delay_linear;
-}
-
static int mba_sc_domain_allocate(struct rdt_resource *r, struct rdt_ctrl_domain *d)
{
u32 num_closid = resctrl_arch_get_num_closid(r);
@@ -2621,7 +2616,7 @@ static bool supports_mba_mbps(void)
struct rdt_resource *r = resctrl_arch_get_resource(RDT_RESOURCE_MBA);
return (resctrl_is_mbm_enabled() &&
- r->alloc_capable && is_mba_linear() &&
+ r->alloc_capable && r->membw.delay_linear &&
r->ctrl_scope == rmbm->mon_scope &&
!rmbm->mon.mbm_cntr_assignable);
}
--
2.56.0