Re: [PATCH v6 41/42] x86/resctrl: Move the filesystem bits to headers visible to fs/resctrl
From: James Morse
Date: Fri Feb 28 2025 - 14:59:33 EST
Hi Reinette,
On 20/02/2025 06:00, Reinette Chatre wrote:
> On 2/7/25 10:18 AM, James Morse wrote:
>> Once the filesystem parts of resctrl move to fs/resctrl, it cannot rely
>> on definitions in x86's internal.h.
>>
>> Move definitions in internal.h that need to be shared between the
>> filesystem and architecture code to header files that fs/resctrl can
>> include.
>>
>> Doing this separately means the filesystem code only moves between files
>> of the same name, instead of having these changes mixed in too.
>> diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
>> index 6303c0ee0ae2..f2cd7ba39fcc 100644
>> --- a/arch/x86/kernel/cpu/resctrl/core.c
>> +++ b/arch/x86/kernel/cpu/resctrl/core.c
>> @@ -288,6 +288,11 @@ static void rdt_get_cdp_l2_config(void)
>> rdt_get_cdp_config(RDT_RESOURCE_L2);
>> }
>>
>> +bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l)
>> +{
>> + return rdt_resources_all[l].cdp_enabled;
>> +}
>> +
>
> This moves resctrl_arch_get_cdp_enabled() to arch/x86/kernel/cpu/resctrl/core.c
> while resctrl_arch_set_cdp_enabled() is already in arch/x86/kernel/cpu/resctrl/rdtgroup.c.
> Most of resctrl_arch_get_cdp_enabled()'s callers are
> in arch/x86/kernel/cpu/resctrl/rdtgroup.c so it seems appropriate to keep it with
> its partner resctrl_arch_set_cdp_enabled()?
Yup - that would make more sense.
(This will date back to when I was moving the code around by hand every release!)
Thanks,
James