[PATCH v7 0/4] x86/resctrl: mba_MBps enhancements

From: Tony Luck
Date: Thu Oct 03 2024 - 15:12:56 EST


[
Bringing this old patch series out of hibernation since last December
]

Two changes relating to the MBA Software Controller(mba_sc):

1) Add a new mount option so the user can choose which memory
bandwidth monitoring event to use as the input to the feedback
loop.

2) Update the "mba_MBps" mount option to make use of total memory
bandwidth event on systems that do not support local bandwidth
event.

Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>

---
Changes since v6: https://lore.kernel.org/all/20231207195613.153980-1-tony.luck@xxxxxxxxx/

Peter Newman:
s/"mbm_Local_bytes"/"mbm_local_bytes"/
Added WARN_ON() to check non-null return from get_mbm_state()
Don't allow both local and total mount options at same time

Reinette Chatre:
Use flag (enable_mba_mbps) and value (mba_mbps_event) in
struct rdt_fs_context. Then pass the value to r->membw.mba_mbps_event
Ditto Peter's comment to block multiple uses of mount options.
Use invalfc() for better error reporting to user
Note in kerneldoc that mba_mbps_event only valid when @mba_sc is true
Declare mba_sc_event_opt_name() as "const char *"
Rework resctrl.rst patch based on comments

Babu Moger:
Clean up calling sequence for set_mba_sc() to avoid dummy 2nd argument

Other changes:
I split first patch into two parts:
1) the periodic updates to use r->membw.mba_mbps_event to choose
the event
2) The new mount option

Also noticed code duplication in mbm_update() as the local
and total clauses are now identical. Split that code into
a helper function mbm_update_one_event()


Tony Luck (4):
x86/resctrl: Make input event for MBA Software Controller configurable
x86/resctrl: Add mount option to pick input event for mba_MBps mode
x86/resctrl: Use total bandwidth for mba_MBps option when local isn't
present
x86/resctrl: Add new "mba_MBps_event" mount option to documentation

Documentation/arch/x86/resctrl.rst | 27 +++++++--
include/linux/resctrl.h | 2 +
arch/x86/kernel/cpu/resctrl/internal.h | 1 +
arch/x86/kernel/cpu/resctrl/monitor.c | 80 ++++++++++++--------------
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 51 +++++++++++++---
5 files changed, 102 insertions(+), 59 deletions(-)

--
2.46.1