lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0116f39-25c8-f90e-6d6d-625e363acf6a@amd.com>
Date:   Wed, 30 Aug 2023 18:24:55 -0500
From:   "Moger, Babu" <babu.moger@....com>
To:     Reinette Chatre <reinette.chatre@...el.com>, corbet@....net,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de
Cc:     fenghua.yu@...el.com, dave.hansen@...ux.intel.com, x86@...nel.org,
        hpa@...or.com, paulmck@...nel.org, akpm@...ux-foundation.org,
        quic_neeraju@...cinc.com, rdunlap@...radead.org,
        damien.lemoal@...nsource.wdc.com, songmuchun@...edance.com,
        peterz@...radead.org, jpoimboe@...nel.org, pbonzini@...hat.com,
        chang.seok.bae@...el.com, pawan.kumar.gupta@...ux.intel.com,
        jmattson@...gle.com, daniel.sneddon@...ux.intel.com,
        sandipan.das@....com, tony.luck@...el.com, james.morse@....com,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        bagasdotme@...il.com, eranian@...gle.com,
        christophe.leroy@...roup.eu, jarkko@...nel.org,
        adrian.hunter@...el.com, quic_jiles@...cinc.com,
        peternewman@...gle.com
Subject: Re: [PATCH v8 6/8] x86/resctrl: Move default group file creation to
 mount

Hi Reinette,

On 8/30/23 17:05, Reinette Chatre wrote:
> Hi Babu,
> 
> On 8/30/2023 2:18 PM, Moger, Babu wrote:
>> On 8/30/23 15:00, Reinette Chatre wrote:
>>> On 8/30/2023 12:50 PM, Moger, Babu wrote:
>>>> On 8/29/23 15:11, Reinette Chatre wrote:
>>>>> On 8/21/2023 4:30 PM, 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 <reinette.chatre@...el.com>
>>>>>> Signed-off-by: Babu Moger <babu.moger@....com>
>>>>>> ---
>>>>>>  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);
>>>>>>  
>>>>>
>>>>> From what I can tell these functions are only used in rdtgroup.c.
>>>>> Can this export be avoided by just moving these functions within
>>>>> rdtgroup.c and making them static?
>>>>
>>>> Yes. It is used only in rdtgroup.c. We can make this static by adding the
>>>> prototypes of these function in the beginning of rdtgroup.c file to avoid
>>>> implicit declaration compiler errors.
>>>
>>> Why not just place the functions earlier in rdtgroup.c so that they are
>>> located before all callers? 
>>
>> Couple of problems with that.
>> 1.  rdtgroup_setup_root needs the the definition of
>> rdtgroup_kf_syscall_ops which is defined later in the file.
>>
>> Static struct kernfs_syscall_ops rdtgroup_kf_syscall_ops = {
>>          .mkdir          = rdtgroup_mkdir,
>>          .rmdir          = rdtgroup_rmdir,
>>          .rename         = rdtgroup_rename,
>>          .show_options   = rdtgroup_show_options,
>> };
>>
>> 2. rdtgroup_setup_root is called in rdt_get_tree which is defined earlier
>> in the file.
>>
>> So, this needs re-arrange of all these functions. That is reason I made
>> these functions global. Thought it may be too much a change for this purpose.
> 
> I see, yes, to accomplish this would trigger a lot of churn and also seem
> to cascade into other dependencies needing to be taken into account.
> As you suggested the static declaration can be added to the top of rdtgroup.c
> as proposal for the next stage.
> 

Sure.
Thanks
Babu Moger

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ