[PATCH 1/5] fs/resctrl: Drop support for different bandwidth delay mappings

From: Reinette Chatre

Date: Thu Sep 03 2026 - 13:07:11 EST


The original Intel MBA support added by commit

05b93417ce5b ("x86/intel_rdt/mba: Add primary support for Memory Bandwidth Allocation (MBA)")

introduced but never used support for different bandwidth delay mappings.

Intel systems only support linear delay values for which there is a
direct map to the percentage based memory bandwidth control. There is no
need to support other bandwidth delay mappings.

Remove the unused resctrl_membw::mb_map and the unnecessary bandwidth delay
mapping function. Perform the direct map to percentage when writing the
control value to hardware.

Signed-off-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
---
Changes since RFC v1:
- Also drop separate delay_bw_map() and instead integrate the only
mapping to when control value is written.

Changes since RFC v2:
- Rework changelog.
---
arch/x86/kernel/cpu/resctrl/core.c | 23 +++++++----------------
include/linux/resctrl.h | 2 --
2 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 55214d6fdc49..65cfde0d6a9b 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -323,29 +323,20 @@ static void mba_wrmsr_amd(struct msr_param *m)
wrmsrq(hw_res->msr_base + i, hw_dom->ctrl_val[i]);
}

-/*
- * Map the memory b/w percentage value to delay values
- * that can be written to QOS_MSRs.
- * There are currently no SKUs which support non linear delay values.
- */
-static u32 delay_bw_map(unsigned long bw, struct rdt_resource *r)
-{
- if (r->membw.delay_linear)
- return MAX_MBA_BW - bw;
-
- pr_warn_once("Non Linear delay-bw map not supported but queried\n");
- return MAX_MBA_BW;
-}
-
static void mba_wrmsr_intel(struct msr_param *m)
{
struct rdt_hw_ctrl_domain *hw_dom = resctrl_to_arch_ctrl_dom(m->dom);
struct rdt_hw_resource *hw_res = resctrl_to_arch_res(m->res);
unsigned int i;

- /* Write the delay values for mba. */
+ if (!m->res->membw.delay_linear) {
+ pr_warn_once("Non-linear bandwidth delay not supported\n");
+ return;
+ }
+
+ /* Program bandwidth percentage mapped to linear delay value. */
for (i = m->low; i < m->high; i++)
- wrmsrq(hw_res->msr_base + i, delay_bw_map(hw_dom->ctrl_val[i], m->res));
+ wrmsrq(hw_res->msr_base + i, MAX_MBA_BW - hw_dom->ctrl_val[i]);
}

static void cat_wrmsr(struct msr_param *m)
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 10dfdca7f4bf..b63dc62690ca 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -253,7 +253,6 @@ enum membw_throttle_mode {
* @throttle_mode: Bandwidth throttling mode when threads request
* different memory bandwidths
* @mba_sc: True if MBA software controller(mba_sc) is enabled
- * @mb_map: Mapping of memory B/W percentage to memory B/W delay
*/
struct resctrl_membw {
u32 min_bw;
@@ -263,7 +262,6 @@ struct resctrl_membw {
bool arch_needs_linear;
enum membw_throttle_mode throttle_mode;
bool mba_sc;
- u32 *mb_map;
};

struct resctrl_schema;
--
2.55.0