Re: [PATCH v10 09/14] x86/sgx: Implement async reclamation for cgroup

From: Haitao Huang
Date: Thu Apr 04 2024 - 11:39:40 EST


On Thu, 04 Apr 2024 06:16:54 -0500, Huang, Kai <kai.huang@xxxxxxxxx> wrote:

On Wed, 2024-03-27 at 17:22 -0700, Haitao Huang wrote:
void sgx_cgroup_init(void)
{
+ sgx_cg_wq = alloc_workqueue("sgx_cg_wq", WQ_UNBOUND | WQ_FREEZABLE, WQ_UNBOUND_MAX_ACTIVE);
+
+ /* All Cgroups functionalities are disabled. */
+ if (WARN_ON(!sgx_cg_wq))
+ return;
+

I don't think you should WARN(), because it's not a kernel bug or similar. Just
print a message saying EPC cgroup is disabled and move on.

if (!sgx_cg_wq) {
pr_err("SGX EPC cgroup disabled: alloc_workqueue() failed.\n");
return;
}


Sure
Thanks
Haitao