Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-24 Thread Jarkko Sakkinen
On Tue, Feb 23, 2021 at 01:42:04PM -0800, Dave Hansen wrote: > This doesn't look like it addresses all of the suggestions that I made > two days ago. Is that coming in v3? You mean v2 does not address? /Jarkko

Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-24 Thread Jarkko Sakkinen
On Tue, Feb 23, 2021 at 11:14:10AM -0800, Dave Hansen wrote: > On 2/21/21 4:54 PM, Dave Hansen wrote: > > Instead of having a for-each-section loop, I'd make it for-each-node -> > > for-each-section. Something like: > > > > for (i = 0; i < num_possible_nodes(); i++) { > > node = (

Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-23 Thread Dave Hansen
This doesn't look like it addresses all of the suggestions that I made two days ago. Is that coming in v3?

Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-23 Thread Jarkko Sakkinen
On Tue, Feb 23, 2021 at 11:20:55AM -0800, Dave Hansen wrote: > On 2/23/21 11:17 AM, Jarkko Sakkinen wrote: > > Instead, let's just: > > > > 1. Have a global sgx_free_epc_list and remove sgx_epc_section. > >Pages from this are allocated from this in LIFO fashion. > > 2. Instead add struct list_

Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-23 Thread Dave Hansen
On 2/23/21 11:17 AM, Jarkko Sakkinen wrote: > Instead, let's just: > > 1. Have a global sgx_free_epc_list and remove sgx_epc_section. >Pages from this are allocated from this in LIFO fashion. > 2. Instead add struct list_head node_list and use that for node >associated pages. > 3. Replace

Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-23 Thread Jarkko Sakkinen
On Sun, Feb 21, 2021 at 04:54:33PM -0800, Dave Hansen wrote: > > +/* Nodes with one or more EPC sections. */ > > +static nodemask_t sgx_numa_mask; > > I'd also add that this is for optimization only. > > > +/* Array of lists of EPC sections for each NUMA node. */ > > +struct list_head *sgx_numa_n

Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-23 Thread Dave Hansen
On 2/21/21 4:54 PM, Dave Hansen wrote: > Instead of having a for-each-section loop, I'd make it for-each-node -> > for-each-section. Something like: > > for (i = 0; i < num_possible_nodes(); i++) { > node = (numa_node_id() + i) % num_possible_nodes() > >

Re: [PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-21 Thread Dave Hansen
> +/* Nodes with one or more EPC sections. */ > +static nodemask_t sgx_numa_mask; I'd also add that this is for optimization only. > +/* Array of lists of EPC sections for each NUMA node. */ > +struct list_head *sgx_numa_nodes; I'd much prefer: /* * Array with one list_head for each possible N

[PATCH] x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

2021-02-20 Thread Jarkko Sakkinen
Background == EPC section is covered by one or more SRAT entries that are associated with one and only one PXM (NUMA node). The motivation behind this patch is to provide basic elements of building allocation scheme based on this premise. It does not try to fully address NUMA. For instanc