Re: [PATCH v5 10/29] x86/resctrl: Change generic domain functions to use struct rdt_domain_hdr
From: Luck, Tony
Date: Sun Jun 08 2025 - 18:02:52 EST
On Fri, Jun 06, 2025 at 05:52:16PM -0700, Fenghua Yu wrote:
> > -void resctrl_offline_mon_domain(struct rdt_resource *r, struct rdt_mon_domain *d)
> > +void resctrl_offline_mon_domain(struct rdt_resource *r, struct rdt_domain_hdr *hdr)
> > {
> > + struct rdt_mon_domain *d;
> > +
> > mutex_lock(&rdtgroup_mutex);
> > /*
> > @@ -4039,11 +4065,15 @@ void resctrl_offline_mon_domain(struct rdt_resource *r, struct rdt_mon_domain *d
> > * per domain monitor data directories.
> > */
> > if (resctrl_mounted && resctrl_arch_mon_capable())
> > - rmdir_mondata_subdir_allrdtgrp(r, d);
> > + rmdir_mondata_subdir_allrdtgrp(r, hdr);
> > if (r->rid != RDT_RESOURCE_L3)
> > goto done;
> > + if (!domain_header_is_valid(hdr, RESCTRL_MON_DOMAIN, r->rid))
> > + return;
>
> rdtgroup_mutex is being locked right now. Cannot return without unlocking
> it.
>
> s/return;/goto done;/
Yup. Though "goto out_unlock" to meet resctrl style of more meaningful
goto label names.
Thanks
-Tony