Re: [PATCH v6 10/42] x86/resctrl: Remove rdtgroup from update_cpu_closid_rmid()

From: James Morse
Date: Fri Feb 28 2025 - 14:55:45 EST


Hi Babu,

On 27/02/2025 20:25, Moger, Babu wrote:
> On 2/7/25 12:17, James Morse wrote:
>> update_cpu_closid_rmid() takes a struct rdtgroup as an argument, which
>> it uses to update the local CPUs default pqr values. This is a problem
>> once the resctrl parts move out to /fs/, as the arch code cannot
>> poke around inside struct rdtgroup.
>>
>> Rename update_cpu_closid_rmid() as resctrl_arch_sync_cpus_defaults()
>> to be used as the target of an IPI, and pass the effective CLOSID
>> and RMID in a new struct.

>> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
>> index a939c0cec7fe..da3b344d06d3 100644
>> --- a/include/linux/resctrl.h
>> +++ b/include/linux/resctrl.h
>> @@ -266,6 +266,28 @@ struct resctrl_schema {
>> u32 num_closid;
>> };
>>
>> +struct resctrl_cpu_defaults {
>> + u32 closid;
>> + u32 rmid;
>> +};
>> +
>
> Can you please explain why this is part of resctrl.h?
>
> Isn't this part of architecture specific definition?

update_closid_rmid() builds an on-stack copy of this, then IPIs each CPU to call
resctrl_arch_sync_cpu_closid_rmid(). Because of the IPI resctrl would need to invent an
identical structure.
If the filesystem and arch code use of this diverge it may be necessary to duplicate them,
(or declare one inside another), but its not needed today.


Thanks,

James