[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <op.2m0o6j2bwjvjmi@hhuan26-mobl.amr.corp.intel.com>
Date: Mon, 29 Apr 2024 20:31:21 -0500
From: "Haitao Huang" <haitao.huang@...ux.intel.com>
To: "hpa@...or.com" <hpa@...or.com>, "tim.c.chen@...ux.intel.com"
<tim.c.chen@...ux.intel.com>, "linux-sgx@...r.kernel.org"
<linux-sgx@...r.kernel.org>, "x86@...nel.org" <x86@...nel.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"jarkko@...nel.org" <jarkko@...nel.org>, "cgroups@...r.kernel.org"
<cgroups@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "mkoutny@...e.com" <mkoutny@...e.com>,
"tglx@...utronix.de" <tglx@...utronix.de>, "Mehta, Sohil"
<sohil.mehta@...el.com>, "tj@...nel.org" <tj@...nel.org>, "mingo@...hat.com"
<mingo@...hat.com>, "bp@...en8.de" <bp@...en8.de>, "Huang, Kai"
<kai.huang@...el.com>
Cc: "mikko.ylinen@...ux.intel.com" <mikko.ylinen@...ux.intel.com>,
"seanjc@...gle.com" <seanjc@...gle.com>, "anakrish@...rosoft.com"
<anakrish@...rosoft.com>, "Zhang, Bo" <zhanb@...rosoft.com>,
"kristen@...ux.intel.com" <kristen@...ux.intel.com>, "yangjie@...rosoft.com"
<yangjie@...rosoft.com>, "Li, Zhiquan1" <zhiquan1.li@...el.com>,
"chrisyan@...rosoft.com" <chrisyan@...rosoft.com>
Subject: Re: [PATCH v12 12/14] x86/sgx: Turn on per-cgroup EPC reclamation
On Mon, 29 Apr 2024 17:18:05 -0500, Huang, Kai <kai.huang@...el.com> wrote:
>
>>>> /*
>>>> @@ -42,7 +63,8 @@ static inline struct sgx_epc_lru_list
>>>> *sgx_lru_list(struct sgx_epc_page *epc_pag
>>>> */
>>>> static inline bool sgx_can_reclaim(void)
>>>> {
>>>> - return !list_empty(&sgx_global_lru.reclaimable);
>>>> + return !sgx_cgroup_lru_empty(misc_cg_root()) ||
>>>> + !list_empty(&sgx_global_lru.reclaimable);
>>>> }
>>>
>>> Shouldn't this be:
>>>
>>> if (IS_ENABLED(CONFIG_CGROUP_MISC))
>>> return !sgx_cgroup_lru_empty(misc_cg_root());
>>> else
>>> return !list_empty(&sgx_global_lru.reclaimable);
>>> ?
>>>
>>> In this way, it is consistent with the sgx_reclaim_pages_global()
>>> below.
>>>
>> I changed to this way because sgx_cgroup_lru_empty() is now defined in
>> both KConfig cases.
>> And it seems better to minimize use of the KConfig variables based on
>> earlier feedback (some are yours).
>> Don't really have strong preference here. So let me know one way of the
>> other.
>>
>
> But IMHO your code could be confusing, e.g., it can be interpreted as:
>
> The EPC pages can be managed by both the cgroup LRUs and the
> sgx_global_lru simultaneously at runtime when CONFIG_CGROUP_MISC
> is on.
>
> Which is not true.
>
> So we should make the code clearly reflect the true behaviour.
>
Ok, I'll change back.
Thanks
Haitao
Powered by blists - more mailing lists