Skip to content

How to control NUMA node placement for SGX enclave memory allocation Body #1082

@haru864

Description

@haru864

I am running an SGX application on a NUMA system and would like to know how enclave memory is allocated with respect to NUMA nodes.

I use sgx_create_enclave() to initialize the enclave. When observing memory usage before and after the application using numastat, I noticed the following:

  • local_node memory usage increases,
  • other_node memory usage remains unchanged.

Based on this, I assume that SGX enclave memory is allocated only from the NUMA node local to the CPU executing the application.

Questions:

Is this assumption correct?

Is it possible to allocate enclave memory on a remote NUMA node (not the one local to the current CPU)?

Below is the numastat output before and after the SGX application runs:

Before:
                           node0           node1
numa_hit               348313797       250010472
numa_miss                      0               0
numa_foreign                   0               0
interleave_hit            137318          136998
local_node             348272630       249705279
other_node                 41167          305193

After:
                           node0           node1
numa_hit               348325444       250013526
numa_miss                      0               0
numa_foreign                   0               0
interleave_hit            137318          136998
local_node             348284277       249708333
other_node                 41167          305193

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions