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

Moger, Babu
2025-04-22T17:59:37Z

Hi Tony,

On 4/22/2025 12:14 PM, Luck, Tony wrote:
>> 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.
>

oh ok.

I went back and looked at the history.
https://lore.kernel.org/all/20250228195913.24895-38-james.morse@arm.com/

So you are saying, kernfs lookup method is much more complex. So, having
the global list is easy to traverse and efficient?

Thanks
Babu