summaryrefslogtreecommitdiff
path: root/fs/resctrl/internal.h
diff options
context:
space:
mode:
authorBabu Moger <babu.moger@amd.com>2025-09-06 00:34:16 +0300
committerBorislav Petkov (AMD) <bp@alien8.de>2025-09-15 13:21:24 +0300
commitbd85310efd71b9e7809e1b95fe7a60fde42e62db (patch)
treeda6b53a06f8522290e05d5eed30e312f40193d04 /fs/resctrl/internal.h
parentf7a4fb22312646329ba21bc58958fd83fb9fc15d (diff)
downloadlinux-bd85310efd71b9e7809e1b95fe7a60fde42e62db.tar.xz
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
Diffstat (limited to 'fs/resctrl/internal.h')
-rw-r--r--fs/resctrl/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h
index 1cddfff007a2..762705d7eb8d 100644
--- a/fs/resctrl/internal.h
+++ b/fs/resctrl/internal.h
@@ -396,6 +396,8 @@ int resctrl_num_mbm_cntrs_show(struct kernfs_open_file *of, struct seq_file *s,
int resctrl_available_mbm_cntrs_show(struct kernfs_open_file *of, struct seq_file *s,
void *v);
+void rdtgroup_assign_cntrs(struct rdtgroup *rdtgrp);
+
#ifdef CONFIG_RESCTRL_FS_PSEUDO_LOCK
int rdtgroup_locksetup_enter(struct rdtgroup *rdtgrp);