[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b91e6636ab7b6b96a723c9ea78ad5119ea1502c9.camel@intel.com>
Date: Tue, 27 Aug 2024 11:13:41 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "chenridong@...wei.com" <chenridong@...wei.com>,
"linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
"cgroups@...r.kernel.org" <cgroups@...r.kernel.org>, "mkoutny@...e.com"
<mkoutny@...e.com>, "dave.hansen@...ux.intel.com"
<dave.hansen@...ux.intel.com>, "haitao.huang@...ux.intel.com"
<haitao.huang@...ux.intel.com>, "tim.c.chen@...ux.intel.com"
<tim.c.chen@...ux.intel.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "mingo@...hat.com" <mingo@...hat.com>,
"tglx@...utronix.de" <tglx@...utronix.de>, "tj@...nel.org" <tj@...nel.org>,
"jarkko@...nel.org" <jarkko@...nel.org>, "Mehta, Sohil"
<sohil.mehta@...el.com>, "hpa@...or.com" <hpa@...or.com>, "bp@...en8.de"
<bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>
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 v16 08/16] x86/sgx: Encapsulate uses of the global LRU
> +static inline bool sgx_can_reclaim_global(void)
> +{
> + /*
> + * Now all EPC pages are still tracked in the @sgx_global_lru, so only
> + * check @sgx_global_lru.
> + *
> + * When EPC pages are tracked in the actual per-cgroup LRUs,
> + * replace with sgx_cgroup_lru_empty(misc_cg_root()).
> + */
> + return !list_empty(&sgx_global_lru.reclaimable);
> +}
Firstly, sgx_cgroup_lru_empty() is only introduced in the next patch, so it's
wrong to mention it in the comment in _this_ patch.
It's weird to add the above comment here in this patch anyway, since ...
[...]
> +static void sgx_reclaim_pages_global(void)
> +{
> + sgx_reclaim_pages(&sgx_global_lru);
> }
... this function (which is no difference IMHO) doesn't have a similar comment
here.
The similar comment to this function is only added in the later "[PATCH v16
12/16] x86/sgx: Revise global reclamation for EPC cgroups":
static void sgx_reclaim_pages_global(struct mm_struct *charge_mm)
{
+ /*
+ * Now all EPC pages are still tracked in the @sgx_global_lru.
+ * Still reclaim from it.
+ *
+ * When EPC pages are tracked in the actual per-cgroup LRUs,
+ * sgx_cgroup_reclaim_pages_global() will be called.
+ */
sgx_reclaim_pages(&sgx_global_lru, charge_mm);
}
So if the comment of sgx_can_reclaim_global() were needed, it's more
reasonable to add it in the later patch where the comment for
sgx_reclaim_pages_global() is also added IMHO?
Powered by blists - more mailing lists