]> Gentwo Git Trees - linux/.git/commit
fs/resctrl: Add the functionality to unassign MBM events
authorBabu Moger <babu.moger@amd.com>
Fri, 5 Sep 2025 21:34:17 +0000 (16:34 -0500)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 15 Sep 2025 10:22:24 +0000 (12:22 +0200)
commitaab2c5088cdb26e80d51ffbe72d24ab23fa1533e
treee8f0320d8665de4765adec6d7568f4cf62bc65d8
parentbd85310efd71b9e7809e1b95fe7a60fde42e62db
fs/resctrl: Add the functionality to unassign MBM events

The "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. If all the counters are in use, the kernel logs the
error message "Failed to allocate counter for <event> in domain <id>" in
/sys/fs/resctrl/info/last_cmd_status when a new assignment is requested.

To make space for a new assignment, users must unassign an already assigned
counter and retry the assignment again.

Add the functionality to unassign and free the counters in the domain.  Also,
add the helper rdtgroup_unassign_cntrs() to unassign counters in the group.

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