On Tue, Feb 23, 2021 at 11:35:41PM +0200, Jarkko Sakkinen wrote: > 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 instance, it does not provide > integration to the mempolicy API, but neither does introduce any > bottlenecks to address this later on. Memory allocation is a complex topic, > and thus it's better to start with baby steps. > > Solution > ======== > > Use phys_to_target_node() to associate each NUMA node with the EPC sections > contained within its range. > > In sgx_alloc_epc_page(), first try to allocate from the NUMA node, where > the CPU is executing. If that fails, fallback to the legacy allocation. > > Link: https://lore.kernel.org/lkml/158188326978.894464.217282995221175417.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/ > Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx> In [1], 'numa' branch is tip/master with the patch set on top. Haitao, Any chances that you might have time to give a shot at testing this, when the bandwidth allows? [1] https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-sgx.git: /Jarkko