]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs/resctrl: Add the functionality to assign MBM events
authorBabu Moger <babu.moger@amd.com>
Fri, 5 Sep 2025 21:34:16 +0000 (16:34 -0500)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 15 Sep 2025 10:21:24 +0000 (12:21 +0200)
commitbd85310efd71b9e7809e1b95fe7a60fde42e62db
treeda6b53a06f8522290e05d5eed30e312f40193d04
parentf7a4fb22312646329ba21bc58958fd83fb9fc15d
fs/resctrl: Add the functionality to assign MBM events

When supported, "mbm_event" counter assignment mode offers "num_mbm_cntrs"
number of counters that can be assigned to RMID, event pairs and monitor
bandwidth usage as long as it is assigned.

Add the functionality to allocate and assign a counter to an RMID, event
pair in the domain. Also, add the helper rdtgroup_assign_cntrs() to assign
counters in the group.

Log the error message "Failed to allocate counter for <event> in domain
<id>" in /sys/fs/resctrl/info/last_cmd_status if all the counters are in
use. Exit on the first failure when assigning counters across all the
domains.

Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/cover.1757108044.git.babu.moger@amd.com
fs/resctrl/internal.h
fs/resctrl/monitor.c