Barrelfish
|
General Numa functions. More...
Functions | |
struct bitmap * | numa_get_interleave_mask (void) |
returns the current interleave mask More... | |
void | numa_set_interleave_mask (struct bitmap *nodemask) |
sets the memory interleave mask for the current task to nodemask More... | |
void | numa_bind (struct bitmap *nodemask) |
binds the current task and its children to the nodes specified in nodemask. More... | |
void | numa_set_localalloc (void) |
sets the memory allocation policy for the calling task to local allocation. | |
errval_t | numa_set_membind (struct bitmap *nodemask) |
sets the memory allocation mask. More... | |
struct bitmap * | numa_get_membind (void) |
returns the mask of nodes from which memory can currently be allocated. More... | |
void * | numa_alloc_onnode (size_t size, nodeid_t node, size_t pagesize) |
allocates memory on a specific node. More... | |
void * | numa_alloc_local (size_t size, size_t pagesize) |
allocates size bytes of memory on the local node More... | |
void * | numa_alloc_interleaved (size_t size, size_t pagesize) |
allocates size bytes of memory page interleaved on all nodes. More... | |
void * | numa_alloc_interleaved_subset (size_t size, size_t pagesize, struct bitmap *nodemask) |
allocates size bytes of memory page interleaved the nodes specified in the nodemask. More... | |
void * | numa_alloc (size_t size, size_t pagesize) |
allocates size bytes of memory with the current NUMA policy. More... | |
void * | numa_realloc (void *old_addr, size_t old_size, size_t new_size) |
changes the size of the memory area. More... | |
void | numa_free (void *start, size_t size) |
frees size bytes of memory starting at start More... | |
errval_t | numa_frame_alloc_on_node (struct capref *dest, size_t size, nodeid_t node, size_t *ret_size) |
allocates a frame on a specific node More... | |
errval_t | numa_frame_free (struct capref frame) |
frees a previously allocated frame More... | |
errval_t | numa_move_pages (domainid_t did, size_t count, void **pages, const nodeid_t *nodes, errval_t *status, int flags) |
moves a list of pages in the address space of the current domain More... | |
errval_t | numa_migrate_pages (domainid_t did, struct bitmap *fromnodes, struct bitmap *tonodes) |
migrate a domain from one set of nodes to another More... | |
Variables | |
struct bitmap * | numa_alloc_interleave_mask |
< numa interleave mask for allocations More... | |
General Numa functions.
void* numa_alloc | ( | size_t | size, |
size_t | pagesize | ||
) |
allocates size bytes of memory with the current NUMA policy.
size | size of the memory region in bytes |
pagesize | preferred page size to be used |
The memory must be freed with numa_free(). On errors NULL is returned.
void* numa_alloc_interleaved | ( | size_t | size, |
size_t | pagesize | ||
) |
allocates size bytes of memory page interleaved on all nodes.
size | size of the memory region in bytes |
pagesize | preferred page size to be used |
should only be used for large areas consisting of multiple pages. The memory must be freed with numa_free(). On errors NULL is returned.
void* numa_alloc_interleaved_subset | ( | size_t | size, |
size_t | pagesize, | ||
struct bitmap * | nodemask | ||
) |
allocates size bytes of memory page interleaved the nodes specified in the nodemask.
size | size of the memory region in bytes |
nodemask | subset of nodes to consider for allocation |
pagesize | preferred page size to be used |
should only be used for large areas consisting of multiple pages. The memory must be freed with numa_free(). On errors NULL is returned.
void* numa_alloc_local | ( | size_t | size, |
size_t | pagesize | ||
) |
allocates size bytes of memory on the local node
size | size of the memory region in bytes |
pagesize | page size to be used for the mapping |
The memory must be freed with numa_free(). On errors NULL is returned.
void* numa_alloc_onnode | ( | size_t | size, |
nodeid_t | node, | ||
size_t | pagesize | ||
) |
allocates memory on a specific node.
size | size of the region in bytes |
node | ID of the node to allocate from |
pagesize | page size to be used for the mapping |
The size argument will be rounded up to a multiple of the system page size. if the specified node is externally denied to this process, this call will fail. The memory must be freed with numa_free(). On errors NULL is returned.
void numa_bind | ( | struct bitmap * | nodemask | ) |
binds the current task and its children to the nodes specified in nodemask.
nodemask | bitmap representing the nodes |
errval_t numa_frame_alloc_on_node | ( | struct capref * | dest, |
size_t | size, | ||
nodeid_t | node, | ||
size_t * | ret_size | ||
) |
allocates a frame on a specific node
dest | capref to store the frame |
size | size of the frame to allocated |
node | node on which the frame should be allocated |
ret_size | returned size of the frame capability |
errval_t numa_frame_free | ( | struct capref | frame | ) |
frees a previously allocated frame
frame | capability to free |
void numa_free | ( | void * | start, |
size_t | size | ||
) |
frees size bytes of memory starting at start
start | start of the memory region |
size | number of bytes to free |
the memory must be previously allocated by one of the numa_alloc* functions
struct bitmap* numa_get_interleave_mask | ( | void | ) |
returns the current interleave mask
returns the current interleave mask if the task's memory allocation policy is page interleaved. Otherwise, this function returns an empty mask.
struct bitmap* numa_get_membind | ( | void | ) |
returns the mask of nodes from which memory can currently be allocated.
errval_t numa_migrate_pages | ( | domainid_t | did, |
struct bitmap * | fromnodes, | ||
struct bitmap * | tonodes | ||
) |
migrate a domain from one set of nodes to another
did | the domain ID |
fromnodes | bitmap representing the current nodes |
tonodes | bitmap representing the |
errval_t numa_move_pages | ( | domainid_t | did, |
size_t | count, | ||
void ** | pages, | ||
const nodeid_t * | nodes, | ||
errval_t * | status, | ||
int | flags | ||
) |
moves a list of pages in the address space of the current domain
did | the domain ID |
count | number of pages to move |
pages | list of pages |
nodes | list of nodes to which the pages can be moved |
status | returns the outcome for each page |
flags | flags for moving the pages |
void* numa_realloc | ( | void * | old_addr, |
size_t | old_size, | ||
size_t | new_size | ||
) |
changes the size of the memory area.
old_addr | pointer ot the old memory region |
old_size | size of the old memory region |
new_size | new size to allocate |
void numa_set_interleave_mask | ( | struct bitmap * | nodemask | ) |
sets the memory interleave mask for the current task to nodemask
nodemask | bitmask representing the nodes |
All new memory allocations are page interleaved over all nodes in the interleave mask. Interleaving can be turned off again by passing an empty mask.
This bitmask is considered to be a hint. Fallback to other nodes may be possible
errval_t numa_set_membind | ( | struct bitmap * | nodemask | ) |
sets the memory allocation mask.
nodemask | bitmap representing the nodes |
The task will only allocate memory from the nodes set in nodemask.
an empty mask or not allowed nodes in the mask will result in an error
struct bitmap* numa_alloc_interleave_mask |
< numa interleave mask for allocations
numa bind mask for allocations