Re: [PATCH v10 12/14] x86/sgx: Turn on per-cgroup EPC reclamation

From: Haitao Huang
Date: Tue Apr 09 2024 - 00:23:43 EST


On Mon, 08 Apr 2024 17:37:10 -0500, Huang, Kai <kai.huang@xxxxxxxxx> wrote:



On 9/04/2024 6:03 am, Haitao Huang wrote:

The misc root cgroup is a static similar to sgx_cg_root. So misc_cg_root() won't be NULL
However, based on how css_misc() was check NULL, I suppose sgx_get_current_cg() may be NULL when cgroup is disabled (again not 100% sure but we handle it anyway)

Could you help to check? Sorry I am busy on something else thus won't be able to do any actual check.

It's always non-NULL based on testing.

It's hard for me to say definitely by reading the code. But IIUC cgroup_disable command-line only blocks operations in /sys/fs/cgroup so user space can't set up controllers and config limits, etc., for the diasabled ones. Each task->cgroups would still have a non-NULL pointer to the static root object for each cgroup that is enabled by KConfig, so get_current_misc_cg() thus sgx_get_current_cg() should not return NULL regardless 'cgroup_disable=misc'.

Maybe @Michal or @tj can confirm?

Thanks
Haitao