Re: [PATCH v5 15/20] x86/resctrl: Assign/unassign counters by default when ABMC is enabled

Peter Newman
2024-07-26T23:22:55Z

Hi Babu,

On Wed, Jul 3, 2024 at 2:50 PM Babu Moger <babu.moger@amd.com> wrote:

> @@ -3894,6 +3956,17 @@ static int rdtgroup_mkdir_ctrl_mon(struct kernfs_node *parent_kn,
> if (ret)
> goto out_closid_free;
>
> + /*
> + * Assign the counters if ABMC is already enabled.
> + * With the limited number of counters, there can be cases
> + * only on assignment succeed. It is not required to fail
> + * here in that case. Users have the option to assign the
> + * counter later.
> + */
> +
> + if (rdtgroup_assign_cntrs(rdtgrp) < 0)
> + rdt_last_cmd_puts("Monitor assignment failed\n");

Supposing rdtgroup_init_alloc() below fails, would you want to release
the counters allocated here?

> +
> kernfs_activate(rdtgrp->kn);
>
> ret = rdtgroup_init_alloc(rdtgrp);

-Peter