Re: [PATCH v15 05/14] x86/sgx: Implement basic EPC misc cgroup functionality

2024-06-18 Thread Huang, Kai
On Tue, 2024-06-18 at 18:23 -0500, Haitao Huang wrote: > On Tue, 18 Jun 2024 18:15:37 -0500, Huang, Kai wrote: > > > On Tue, 2024-06-18 at 07:56 -0500, Haitao Huang wrote: > > > On Tue, 18 Jun 2024 06:31:09 -0500, Huang, Kai > > > wrote: > > > > > > > > > > > > @@ -921,7 +956,8 @@ static int

Re: [PATCH v15 05/14] x86/sgx: Implement basic EPC misc cgroup functionality

2024-06-18 Thread Haitao Huang
On Tue, 18 Jun 2024 18:15:37 -0500, Huang, Kai wrote: On Tue, 2024-06-18 at 07:56 -0500, Haitao Huang wrote: On Tue, 18 Jun 2024 06:31:09 -0500, Huang, Kai wrote: > > > @@ -921,7 +956,8 @@ static int __init sgx_init(void) > > if (!sgx_page_cache_init()) > > return -ENOM

Re: [PATCH v15 05/14] x86/sgx: Implement basic EPC misc cgroup functionality

2024-06-18 Thread Huang, Kai
On Tue, 2024-06-18 at 07:56 -0500, Haitao Huang wrote: > On Tue, 18 Jun 2024 06:31:09 -0500, Huang, Kai wrote: > > > > > > @@ -921,7 +956,8 @@ static int __init sgx_init(void) > > > if (!sgx_page_cache_init()) > > > return -ENOMEM; > > > > > > - if (!sgx_page_reclaimer_init()) { > >

Re: [PATCH v15 05/14] x86/sgx: Implement basic EPC misc cgroup functionality

2024-06-18 Thread Haitao Huang
On Tue, 18 Jun 2024 06:31:09 -0500, Huang, Kai wrote: @@ -921,7 +956,8 @@ static int __init sgx_init(void) if (!sgx_page_cache_init()) return -ENOMEM; - if (!sgx_page_reclaimer_init()) { + if (!sgx_page_reclaimer_init() || !sgx_cgroup_init()) { +

Re: [PATCH v15 05/14] x86/sgx: Implement basic EPC misc cgroup functionality

2024-06-18 Thread Huang, Kai
> @@ -921,7 +956,8 @@ static int __init sgx_init(void) > if (!sgx_page_cache_init()) > return -ENOMEM; > > - if (!sgx_page_reclaimer_init()) { > + if (!sgx_page_reclaimer_init() || !sgx_cgroup_init()) { > + misc_cg_set_capacity(MISC_CG_RES_SGX_EPC, 0); >

[PATCH v15 05/14] x86/sgx: Implement basic EPC misc cgroup functionality

2024-06-17 Thread Huang, Haitao
From: Kristen Carlson Accardi SGX Enclave Page Cache (EPC) memory allocations are separate from normal RAM allocations, and are managed solely by the SGX subsystem. The existing cgroup memory controller cannot be used to limit or account for SGX EPC memory, which is a desirable feature in some en