Re: [PATCH v4 12/18] x86/sgx: Add EPC OOM path to forcefully reclaim EPC

2023-09-15 Thread Haitao Huang
On Wed, 13 Sep 2023 10:34:28 -0500, Jarkko Sakkinen wrote: +++ b/arch/x86/kernel/cpu/sgx/encl.h @@ -39,6 +39,7 @@ enum sgx_encl_flags { SGX_ENCL_DEBUG = BIT(1), SGX_ENCL_CREATED= BIT(2), SGX_ENCL_INITIALIZED= BIT(3), + SGX_ENCL_OOM

Re: [PATCH v4 12/18] x86/sgx: Add EPC OOM path to forcefully reclaim EPC

2023-09-13 Thread Jarkko Sakkinen
On Wed Sep 13, 2023 at 7:06 AM EEST, Haitao Huang wrote: > From: Sean Christopherson > > Introduce the OOM path for killing an enclave with a reclaimer that is no > longer able to reclaim enough EPC pages. Find a victim enclave, which > will be an enclave with only "unreclaimable" EPC pages left i

[PATCH v4 12/18] x86/sgx: Add EPC OOM path to forcefully reclaim EPC

2023-09-12 Thread Haitao Huang
From: Sean Christopherson Introduce the OOM path for killing an enclave with a reclaimer that is no longer able to reclaim enough EPC pages. Find a victim enclave, which will be an enclave with only "unreclaimable" EPC pages left in the cgroup LRU lists. Once a victim is identified, mark the encl