]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/resctrl: Make mba_sc use total bandwidth if local is not supported
authorTony Luck <tony.luck@intel.com>
Fri, 6 Dec 2024 16:31:45 +0000 (08:31 -0800)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 10 Dec 2024 15:15:14 +0000 (16:15 +0100)
The default input measurement to the mba_sc feedback loop for memory bandwidth
control when the user mounts with the "mba_MBps" option is the local bandwidth
event. But some systems may not support a local bandwidth event.

When local bandwidth event is not supported, check for support of total
bandwidth and use that instead.

Relax the mount option check to allow use of the "mba_MBps" option for systems
when only total bandwidth monitoring is supported. Also update the error
message.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Link: https://lore.kernel.org/r/20241206163148.83828-6-tony.luck@intel.com
arch/x86/kernel/cpu/resctrl/core.c
arch/x86/kernel/cpu/resctrl/rdtgroup.c

index 94bf559966d624650dfc26936dda37c09992892a..3d1735ed8d1ffe67a31f34945a9d02c73a07ecb6 100644 (file)
@@ -965,6 +965,8 @@ static __init bool get_rdt_mon_resources(void)
 
        if (is_mbm_local_enabled())
                mba_mbps_default_event = QOS_L3_MBM_LOCAL_EVENT_ID;
+       else if (is_mbm_total_enabled())
+               mba_mbps_default_event = QOS_L3_MBM_TOTAL_EVENT_ID;
 
        return !rdt_get_mon_l3_config(r);
 }
index 8a52b25ce26b86c476c5bf95ec8619d8a1d81317..0659b8e2a71b51a0f31918d55ff24879e5290472 100644 (file)
@@ -2341,7 +2341,7 @@ static bool supports_mba_mbps(void)
        struct rdt_resource *rmbm = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
        struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA].r_resctrl;
 
-       return (is_mbm_local_enabled() &&
+       return (is_mbm_enabled() &&
                r->alloc_capable && is_mba_linear() &&
                r->ctrl_scope == rmbm->mon_scope);
 }
@@ -2768,7 +2768,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 local MBM and linear scale MBA at L3 scope";
+               msg = "mba_MBps requires MBM and linear scale MBA at L3 scope";
                if (!supports_mba_mbps())
                        return invalfc(fc, msg);
                ctx->enable_mba_mbps = true;