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: <op.2bcjkksxwjvjmi@hhuan26-mobl.amr.corp.intel.com>
Date:   Fri, 15 Sep 2023 23:18:10 -0500
From:   "Haitao Huang" <haitao.huang@...ux.intel.com>
To:     dave.hansen@...ux.intel.com, tj@...nel.org,
        linux-kernel@...r.kernel.org, linux-sgx@...r.kernel.org,
        x86@...nel.org, cgroups@...r.kernel.org, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, hpa@...or.com,
        sohil.mehta@...el.com, "Jarkko Sakkinen" <jarkko@...nel.org>
Cc:     zhiquan1.li@...el.com, kristen@...ux.intel.com, seanjc@...gle.com,
        zhanb@...rosoft.com, anakrish@...rosoft.com,
        mikko.ylinen@...ux.intel.com, yangjie@...rosoft.com
Subject: Re: [PATCH v4 15/18] x86/sgx: Prepare for multiple LRUs

On Wed, 13 Sep 2023 10:42:52 -0500, Jarkko Sakkinen <jarkko@...nel.org>  
wrote:

> On Wed Sep 13, 2023 at 7:06 AM EEST, Haitao Huang wrote:
>> Add sgx_can_reclaim() wrapper and encapsulate direct references to the
>> global LRU list in the reclaimer functions so that they can be called  
>> with
>> an LRU list per EPC cgroup.
>>
>> Signed-off-by: Sean Christopherson <sean.j.christopherson@...el.com>
>> Signed-off-by: Kristen Carlson Accardi <kristen@...ux.intel.com>
>> Signed-off-by: Haitao Huang <haitao.huang@...ux.intel.com>
>> Cc: Sean Christopherson <seanjc@...gle.com>
>> ---
>> V4:
>> - Re-organized this patch to include all changes related to
>> encapsulation of the global LRU
>> - Moved this patch to precede the EPC cgroup patch
>> ---
>>  arch/x86/kernel/cpu/sgx/main.c | 41 +++++++++++++++++++++++-----------
>>  1 file changed, 28 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/sgx/main.c  
>> b/arch/x86/kernel/cpu/sgx/main.c
>> index ce316bd5e5bb..3d396fe5ec09 100644
>> --- a/arch/x86/kernel/cpu/sgx/main.c
>> +++ b/arch/x86/kernel/cpu/sgx/main.c
>> @@ -34,6 +34,16 @@ static DEFINE_XARRAY(sgx_epc_address_space);
>>   */
>>  static struct sgx_epc_lru_lists sgx_global_lru;
>>
>> +static inline struct sgx_epc_lru_lists *sgx_lru_lists(struct  
>> sgx_epc_page *epc_page)
>> +{
>> +	return &sgx_global_lru;
>> +}
>
> I'd simply export sgx_global_lru.
>
The purpose of this patch to to hide sgx_global_lru so later we can have  
LRU per cgroup.
I'll update the commit message to make it clear this is not just for   
sgx_can_reclaim

>> +static inline bool sgx_can_reclaim(void)
>> +{
>> +	return !list_empty(&sgx_global_lru.reclaimable);
>> +}
>
>
> Accessors for the object should be named so that this fact is reflected,
> e.g. sgx_global_lru_can_reclaim() in this case.
>
> I would just open code this to the call sites though.
>
ditto

Thanks
Haitao

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ