2023-09-05 16:05:36

by Fenghua Yu

[permalink] [raw]
Subject: Re: [PATCH v8 6/8] x86/resctrl: Move default group file creation to mount

Hi, Reinette,

On 9/1/23 16:36, Reinette Chatre wrote:
> Hi Fenghua,
>
> On 9/1/2023 4:21 PM, Fenghua Yu wrote:
>> On 8/21/23 16:30, Babu Moger wrote:
>>> The default resource group and its files are created during kernel
>>> init time. Upcoming changes will make some resctrl files optional
>>> based on a mount parameter. If optional files are to be added to the
>>> default group based on the mount option, then each new file needs to
>>> be created separately and call kernfs_activate() again.
>>>
>>> Create all files of the default resource group during resctrl
>>> mount, destroyed during unmount, to avoid scattering resctrl
>>> file addition across two separate code flows.
>>>
>>> Suggested-by: Reinette Chatre <[email protected]>
>>> Signed-off-by: Babu Moger <[email protected]>
>>> ---
>>>   arch/x86/kernel/cpu/resctrl/internal.h |  2 +
>>>   arch/x86/kernel/cpu/resctrl/rdtgroup.c | 55 +++++++++++++++-----------
>>>   2 files changed, 33 insertions(+), 24 deletions(-)
>>>
>>> diff --git a/arch/x86/kernel/cpu/resctrl/internal.h b/arch/x86/kernel/cpu/resctrl/internal.h
>>> index b09e7abd1299..44ad98f8c7af 100644
>>> --- a/arch/x86/kernel/cpu/resctrl/internal.h
>>> +++ b/arch/x86/kernel/cpu/resctrl/internal.h
>>> @@ -611,5 +611,7 @@ void rdt_domain_reconfigure_cdp(struct rdt_resource *r);
>>>   void __init thread_throttle_mode_init(void);
>>>   void __init mbm_config_rftype_init(const char *config);
>>>   void rdt_staged_configs_clear(void);
>>> +int rdtgroup_setup_root(struct rdt_fs_context *ctx);
>>> +void rdtgroup_destroy_root(void);
>>
>> These two functions are called only in rdtgroup.c. Why are they exposed here?
>>
>
> Could you please take a look at the email thread [1] that
> discusses this? We reached a compromise but would appreciate
> if you have any guidance on the right solution.

Yes, putting the static declarations earlier in rdtgroup.c is right AFAICT.

>
> Reinette
>
> [1] https://lore.kernel.org/lkml/[email protected]/
>

Thanks.

-Fenghua