Re: [PATCH v10 06/12] x86/resctrl: Attach ACPI ERDT information to L3 mon domain on CPU online

From: Chen Yu

Date: Thu Dec 03 2026 - 11:03:27 EST


Hi Reinette,

On Wed, Dec 02, 2026 at 11:12:53AM -0800, Reinette Chatre wrote:
> Hi Chenyu,
>
> On 11/26/26 7:15 AM, Chen Yu wrote:
> > On Wed, Nov 25, 2026 at 11:05:24AM -0800, Reinette Chatre wrote:
> >> On 11/5/26 2:08 AM, Chen Yu wrote:
>
> ..
>
> >>> +/**
> >>> + * erdt_l3_mon_domain_setup() - Associate ERDT table information with an L3
> >>> + * monitoring domain.
> >>> + * @hdr: Header of the L3 monitoring domain being created
> >>> + *
> >>> + * The CPU creating this domain has passed erdt_try_bind_domain(), which bound
> >>> + * an ERDT domain to this CPU's L3 cache ID. Without SNC the L3 monitoring
> >>> + * domain ID is also the L3 cache ID, so a match is always found and
> >>> + * hw_dom->d_info always points to a valid ERDT domain while ERDT is enabled.
> >>> + */
> >>> +void erdt_l3_mon_domain_setup(struct rdt_domain_hdr *hdr)
> >>> +{
> >>> + struct rdt_hw_l3_mon_domain *hw_dom;
> >>> + struct erdt_domain_info *d;
> >>> +
> >>> + lockdep_assert_held(&domain_list_lock);
> >>> +
> >>> + if (!erdt_enabled)
> >>> + return;
> >>> +
> >>
> >> Could you please add a struct rdt_resource * as parameter and add a warning here
> >> that will complain loudly if r->mon_scope is not RESCTRL_L3_CACHE? This function
> >> currently has an assumption that is enforced elsewhere that makes this flow
> >> difficult to follow, considering it is called when SNC is enabled but subtly
> >> relying on being gated by the !erdt_enabled check.
> >>
> >
> > OK, this is to protect against SNC I suppose? Will change it in next version.
> Partly, yes. Primarily it adds documentation and enforcement for developers that try
> to understand and modify this code at a later time. This is similar to how a
> lockdep_assert_held() is more useful than a function comment that a lock must be held.
>

Thanks for this explanation, will do.

thanks,
Chenyu