RE: [PATCH v8 19/25] x86/resctrl: Auto assign/unassign counters when mbm_cntr_assign is enabled
From: Luck, Tony
Date: Tue Oct 15 2024 - 12:57:38 EST
> Sounds fine with me. Now it will look like this below.
>
>
> static void rdtgroup_assign_cntrs(struct rdtgroup *rdtgrp)
> {
> struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
>
> if (!resctrl_arch_mbm_cntr_assign_enabled(r))
> return;
>
> if (is_mbm_total_enabled())
> rdtgroup_assign_cntr_event(r, rdtgrp, NULL, QOS_L3_MBM_TOTAL_EVENT_ID);
>
> if (is_mbm_local_enabled())
> rdtgroup_assign_cntr_event(r, rdtgrp, NULL, QOS_L3_MBM_LOCAL_EVENT_ID);
>
> }
>
> /*
> * Called when a group is deleted. Counters are unassigned if it was in
> * assigned state.
> */
> static void rdtgroup_unassign_cntrs(struct rdtgroup *rdtgrp)
> {
> struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_L3].r_resctrl;
>
> if (!resctrl_arch_mbm_cntr_assign_enabled(r))
> return;
>
> if (is_mbm_total_enabled())
> rdtgroup_unassign_cntr_event(r, rdtgrp, NULL, QOS_L3_MBM_TOTAL_EVENT_ID);
>
> if (is_mbm_local_enabled())
> rdtgroup_unassign_cntr_event(r, rdtgrp, NULL, QOS_L3_MBM_LOCAL_EVENT_ID);
>
> }
Much cleaner. Thanks.
-Tony