Re: [PATCH v16 18/34] fs/resctrl: Add the functionality to unassign MBM events
From: Reinette Chatre
Date: Wed Jul 30 2025 - 15:55:43 EST
Hi Babu,
On 7/25/25 11:29 AM, Babu Moger wrote:
> 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 "Unable to allocate counter in domain" in
Needs an update to match new message.
> /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.
>
> Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
> ---
...
> ---
> fs/resctrl/internal.h | 2 ++
> fs/resctrl/monitor.c | 46 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 48 insertions(+)
>
> diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h
> index 419423bdabdc..216588842444 100644
> --- a/fs/resctrl/internal.h
> +++ b/fs/resctrl/internal.h
> @@ -389,6 +389,8 @@ int resctrl_find_cleanest_closid(void);
>
> int rdtgroup_assign_cntr_event(struct rdt_mon_domain *d, struct rdtgroup *rdtgrp,
> struct mon_evt *mevt);
> +void rdtgroup_unassign_cntr_event(struct rdt_mon_domain *d, struct rdtgroup *rdtgrp,
> + struct mon_evt *mevt);
>
Similar comment as previous patch. Please try to keep all monitoring code in
monitor.c. The caller rdtgroup_unassign_cntrs() can move to monitor.c and it
can instead be made available via internal.h
> #ifdef CONFIG_RESCTRL_FS_PSEUDO_LOCK
> int rdtgroup_locksetup_enter(struct rdtgroup *rdtgrp);
Reinette