linux/fs/resctrl
Babu Moger ef712fe97e fs/resctrl: Auto assign counters on mkdir and clean up on group removal
Resctrl provides a user-configurable option mbm_assign_on_mkdir that
determines if a counter will automatically be assigned to an RMID, event pair
when its associated monitor group is created via mkdir.

Enable mbm_assign_on_mkdir by default to automatically assign counters to
the two default events (MBM total and MBM local) of a new monitoring group
created via mkdir. This maintains backward compatibility with original
resctrl support for these two events.

Unassign and free counters belonging to a monitoring group when the group
is deleted.

Monitor group creation does not fail if a counter cannot be assigned to one or
both events. There may be limited counters and users have the flexibility to
modify counter assignments at a later time. Log the error message "Failed to
allocate counter for <event> in domain <id>" in
/sys/fs/resctrl/info/last_cmd_status when a new monitoring group is created
but counter assignment failed.

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
2025-09-15 12:44:04 +02:00
..
ctrlmondata.c fs/resctrl: Support counter read/reset with mbm_event assignment mode 2025-09-15 12:38:58 +02:00
internal.h fs/resctrl: Introduce mbm_assign_on_mkdir to enable assignments on mkdir 2025-09-15 12:42:02 +02:00
Kconfig x86,fs/resctrl: Move the resctrl filesystem code to live in /fs/resctrl 2025-05-16 14:36:09 +02:00
Makefile
monitor.c fs/resctrl: Auto assign counters on mkdir and clean up on group removal 2025-09-15 12:44:04 +02:00
monitor_trace.h x86,fs/resctrl: Move the resctrl filesystem code to live in /fs/resctrl 2025-05-16 14:36:09 +02:00
pseudo_lock.c resctrl: get rid of pointless debugfs_file_{get,put}() 2025-07-09 13:30:28 +02:00
rdtgroup.c fs/resctrl: Auto assign counters on mkdir and clean up on group removal 2025-09-15 12:44:04 +02:00