Re: [PATCH v5 12/40] x86/resctrl: Wrap resctrl_arch_find_domain() around rdt_find_domain()

From: James Morse
Date: Fri Feb 07 2025 - 10:44:53 EST


Hi Reinette,

On 23/10/2024 22:16, Reinette Chatre wrote:
> On 10/4/24 11:03 AM, James Morse wrote:
>> rdt_find_domain() finds a domain given a resource and a cache-id.
>> It's not quite right for the resctrl arch API as it also returns the
>> position to insert a new domain, which is needed when bringing a
>> domain online in the arch code.
>>
>> Wrap rdt_find_domain() in another function resctrl_arch_find_domain()
>> in order to avoid the unnecessary argument outside the arch code.
>
> I do not understand the motivation for this split. There does not seem to be
> anything arch specific about rdt_find_domain().

Not arch specific, but behaviour only the arch code could use - returning the position to
insert a new domain, which only the arch code will ever do.


> Why does this need to
> be arch API? Why can resctrl and all archs not use rdt_find_domain()?

Just to remove the extra boiler plate caused by the ability to insert an entry - which the
filesystem never does.

If no-one cares, I'll just move it to a header file as-is.


Thanks,

James