mbox series

[v3,0/5] x86/sgx: NUMA

Message ID 20210303150323.433207-1-jarkko@kernel.org (mailing list archive)
Headers show
Series x86/sgx: NUMA | expand

Message

Jarkko Sakkinen March 3, 2021, 3:03 p.m. UTC
Make sgx_alloc_epc_page() more balanced among the NUMA nodes, refactoring
hierarchical listi into a single global free list managed in FIFO fashion.

Introduce NUMA node local free EPC page lists. In sgx_alloc_epc_page(), try
first to allocate from the local free list, and fallback to global free
list, if the local list is empty.

v3:
* Expanded into a full patch set, which also implements more balanced
  EPC allocation among the NUMA nodes. Since none of the patches fully
  match the previous single patch entry, included earlier change log
  to the cover letter.
v2:
* s/section_list/numa_section_list/
* s/MAX_NUMNODES//num_possible_nodes()/
* Add more verbose inline comments that Dave provided.
* If NUMA mapping fails, print a warning and description of the fallbck.
  The physical address is alredy printed in pr_info(), just before the
  mapping happens.

Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Haitao Huang <haitao.huang@linux.intel.com>

Jarkko Sakkinen (5):
  x86/sgx: Fix a resource leak in sgx_init()
  x86/sgx: Use sgx_free_epc_page() in sgx_reclaim_pages()
  x86/sgx: Replace section->init_laundry_list with a temp list
  x86/sgx: Replace section->page_list with a global free page list
  x86/sgx: Add a basic NUMA allocation scheme to sgx_alloc_epc_page()

 arch/x86/Kconfig               |   1 +
 arch/x86/kernel/cpu/sgx/main.c | 217 +++++++++++++++++++++------------
 arch/x86/kernel/cpu/sgx/sgx.h  |  22 ++--
 3 files changed, 146 insertions(+), 94 deletions(-)