RE: [PATCH v8 08/21] x86/resctrl: Expand the width of dom_id by replacing mon_data_bits

Luck, Tony
2025-04-22T17:14:44Z

> Do we really need to maintain a separate list for all the private pointers?
>
> Here's my understanding of the patch—please correct me if I’m missing
> anything:
>
> Patch Requirements:
>
> 1. Expand dom_id.
>
> 2. Pack all necessary data (dom_id, event_id, resid) into the
> of->kn->priv pointer when creating event files in the mon_data
> directory for each domain.

This step includes searching the list of previously created priv structures
to find a matching one that can be shared. This happens all the time
because the same set of values is re-used over and over. Essentially
we only allocate anything while creating the mon_data directory in the
root directory of resctrl. James' original implementation made use of
this by special case allocation for the default group, and then doing
kernfs lookups while creating new groups to find the matching one
and linking to the same ->priv pointer.

-Tony