Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-13 Thread Jarkko Sakkinen
On Sat Jan 13, 2024 at 11:04 PM EET, Jarkko Sakkinen wrote: > On Fri Jan 12, 2024 at 7:07 PM EET, Haitao Huang wrote: > > On Sun, 17 Dec 2023 19:44:56 -0600, Huang, Kai wrote: > > > > > > > >> > > > >> > The point is, with or w/o this patch, you can only reclaim 16 EPC > > >> pages > > >> > in

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-13 Thread Jarkko Sakkinen
On Fri Jan 12, 2024 at 7:07 PM EET, Haitao Huang wrote: > On Sun, 17 Dec 2023 19:44:56 -0600, Huang, Kai wrote: > > > > >> > > >> > The point is, with or w/o this patch, you can only reclaim 16 EPC > >> pages > >> > in one > >> > function call (as you have said you are going to remove > >> >

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-12 Thread Haitao Huang
On Sun, 17 Dec 2023 19:44:56 -0600, Huang, Kai wrote: > > The point is, with or w/o this patch, you can only reclaim 16 EPC pages > in one > function call (as you have said you are going to remove > SGX_NR_TO_SCAN_MAX, > which is a cipher to both of us). The only difference I can see is,

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-05 Thread Mikko Ylinen
On Thu, Jan 04, 2024 at 01:11:15PM -0600, Haitao Huang wrote: > Hi Dave, > > On Wed, 03 Jan 2024 10:37:35 -0600, Dave Hansen > wrote: > > > On 12/18/23 13:24, Haitao Huang wrote:> @Dave and @Michal, Your > > thoughts? Or could you confirm we should not > > > do reclaim per cgroup at all? > >

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-04 Thread Haitao Huang
On Thu, 04 Jan 2024 13:27:07 -0600, Dave Hansen wrote: On 1/4/24 11:11, Haitao Huang wrote: If those are OK with users and also make it acceptable for merge quickly, I'm happy to do that  How about we put some actual numbers behind this? How much complexity are we talking about here?

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-04 Thread Dave Hansen
On 1/4/24 11:11, Haitao Huang wrote: > If those are OK with users and also make it acceptable for merge > quickly, I'm happy to do that  How about we put some actual numbers behind this? How much complexity are we talking about here? What's the diffstat for the utterly bare-bones

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-04 Thread Haitao Huang
Hi Michal, On Thu, 04 Jan 2024 06:38:41 -0600, Michal Koutný wrote: Hello. On Mon, Dec 18, 2023 at 03:24:40PM -0600, Haitao Huang wrote: Thanks for raising this. Actually my understanding the above discussion was mainly about not doing reclaiming by killing enclaves, i.e., I assumed

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-04 Thread Jarkko Sakkinen
On Thu Jan 4, 2024 at 9:11 PM EET, Haitao Huang wrote: > > The key question here is whether we want the SGX VM to be complex and > > more like the real VM or simple when a cgroup hits its limit. Right? > > > > Although it's fair to say the majority of complexity of this series is in > support

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-04 Thread Haitao Huang
Hi Dave, On Wed, 03 Jan 2024 10:37:35 -0600, Dave Hansen wrote: On 12/18/23 13:24, Haitao Huang wrote:> @Dave and @Michal, Your thoughts? Or could you confirm we should not do reclaim per cgroup at all? What's the benefit of doing reclaim per cgroup? Is that worth the extra complexity?

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-04 Thread Michal Koutný
Hello. On Mon, Dec 18, 2023 at 03:24:40PM -0600, Haitao Huang wrote: > Thanks for raising this. Actually my understanding the above discussion was > mainly about not doing reclaiming by killing enclaves, i.e., I assumed > "reclaiming" within that context only meant for that particular kind. >

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2024-01-03 Thread Dave Hansen
On 12/18/23 13:24, Haitao Huang wrote:> @Dave and @Michal, Your thoughts? Or could you confirm we should not > do reclaim per cgroup at all? What's the benefit of doing reclaim per cgroup? Is that worth the extra complexity? The key question here is whether we want the SGX VM to be complex and

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-18 Thread Haitao Huang
On Sun, 17 Dec 2023 19:44:56 -0600, Huang, Kai wrote: > > The point is, with or w/o this patch, you can only reclaim 16 EPC pages > in one > function call (as you have said you are going to remove > SGX_NR_TO_SCAN_MAX, > which is a cipher to both of us). The only difference I can see is,

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-18 Thread Mikko Ylinen
On Mon, Dec 18, 2023 at 01:44:56AM +, Huang, Kai wrote: > > Let's focus on enabling functionality first. When you have some real > performance issue that is related to this, we can come back then. > > Btw, I think you need to step back even further. IIUC the whole multiple LRU > thing

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-17 Thread Huang, Kai
> > > > The point is, with or w/o this patch, you can only reclaim 16 EPC pages > > in one > > function call (as you have said you are going to remove > > SGX_NR_TO_SCAN_MAX, > > which is a cipher to both of us). The only difference I can see is, > > with this > > patch, you can have

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-15 Thread Haitao Huang
On Wed, 13 Dec 2023 05:17:11 -0600, Huang, Kai wrote: On Mon, 2023-12-11 at 22:04 -0600, Haitao Huang wrote: Hi Kai On Mon, 27 Nov 2023 03:57:03 -0600, Huang, Kai wrote: > On Mon, 2023-11-27 at 00:27 +0800, Haitao Huang wrote: > > On Mon, 20 Nov 2023 11:45:46 +0800, Huang, Kai > >

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-13 Thread Huang, Kai
On Mon, 2023-12-11 at 22:04 -0600, Haitao Huang wrote: > Hi Kai > > On Mon, 27 Nov 2023 03:57:03 -0600, Huang, Kai wrote: > > > On Mon, 2023-11-27 at 00:27 +0800, Haitao Huang wrote: > > > On Mon, 20 Nov 2023 11:45:46 +0800, Huang, Kai > > > wrote: > > > > > > > On Mon, 2023-10-30 at 11:20

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-12-11 Thread Haitao Huang
Hi Kai On Mon, 27 Nov 2023 03:57:03 -0600, Huang, Kai wrote: On Mon, 2023-11-27 at 00:27 +0800, Haitao Huang wrote: On Mon, 20 Nov 2023 11:45:46 +0800, Huang, Kai wrote: > On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote: > > From: Sean Christopherson > > > > To prepare for

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-11-27 Thread Huang, Kai
On Mon, 2023-11-27 at 00:27 +0800, Haitao Huang wrote: > On Mon, 20 Nov 2023 11:45:46 +0800, Huang, Kai wrote: > > > On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote: > > > From: Sean Christopherson > > > > > > To prepare for per-cgroup reclamation, separate the top-level reclaim > > >

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-11-26 Thread Haitao Huang
On Mon, 20 Nov 2023 11:45:46 +0800, Huang, Kai wrote: On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote: From: Sean Christopherson To prepare for per-cgroup reclamation, separate the top-level reclaim function, sgx_reclaim_epc_pages(), into two separate functions: -

Re: [PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-11-19 Thread Huang, Kai
On Mon, 2023-10-30 at 11:20 -0700, Haitao Huang wrote: > From: Sean Christopherson > > To prepare for per-cgroup reclamation, separate the top-level reclaim > function, sgx_reclaim_epc_pages(), into two separate functions: > > - sgx_isolate_epc_pages() scans and isolates reclaimable pages from

[PATCH v6 09/12] x86/sgx: Restructure top-level EPC reclaim function

2023-10-30 Thread Haitao Huang
From: Sean Christopherson To prepare for per-cgroup reclamation, separate the top-level reclaim function, sgx_reclaim_epc_pages(), into two separate functions: - sgx_isolate_epc_pages() scans and isolates reclaimable pages from a given LRU list. - sgx_do_epc_reclamation() performs the real