[PATCH v7 3/4] x86/resctrl: Use total bandwidth for mba_MBps option when local isn't present

Tony Luck posted 4 patches 1 month, 3 weeks ago
[PATCH v7 3/4] x86/resctrl: Use total bandwidth for mba_MBps option when local isn't present
Posted by Tony Luck 1 month, 3 weeks ago
On Intel systems the memory bandwidth monitoring events are
independently enumerated. It is possible for a system to support
total memory bandwidth monitoring, but not support local bandwidth
monitoring. On such a system a user could not enable mba_sc mode.

Modify the existing "mba_MBps" mount option to switch to total bandwidth
monitoring if local monitoring is not available.

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 606cf635ea94..433daaa4d125 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -2777,6 +2777,8 @@ static int rdt_parse_param(struct fs_context *fc, struct fs_parameter *param)
 			return invalfc(fc, msg);
 		if (is_mbm_local_enabled())
 			ctx->mba_mbps_event = QOS_L3_MBM_LOCAL_EVENT_ID;
+		else if (is_mbm_total_enabled())
+			ctx->mba_mbps_event = QOS_L3_MBM_TOTAL_EVENT_ID;
 		else
 			return invalfc(fc, msg);
 		ctx->enable_mba_mbps = true;
-- 
2.46.1