-
Notifications
You must be signed in to change notification settings - Fork 8
mrange_node_weight
Important
Please read Bandwidth Expansion instead because the current document is deprecated and no longer valid.
set interleave weight for a memory range
#include <numaif.h>
long mrange_node_weight(unsigned long start, unsigned long len,
const unsigned int *weights, unsigned int weight_count,
unsigned long flags);
Link with -lnuma.
mrange_node_weight()
sets the interleaving weight for the memory range
starting with start
and continuing for len
bytes.
A system with multiple NUMA nodes can have multiple memories including
memory-only NUMA nodes. Interleaving weight defines the ratio how the
system will interleave between those memory nodes. Interleaving weight is
only effective when memory policy is set by set_mempolicy(2)
or mbind(2)
with MPOL_INTERLEAVE_WEIGHT
.
Interleaving weight is specified in weights
. The weight_count
argument
specifies the length of the weights
array. The flags
does nothing for now.
It is preserved for the future.
Note that mrange_node_weight()
has an effect only for the subsequent new
memory allocations.
On success, mrange_node_weight()
returns 0; on error, -1 is returned and
errno is set to indicate the error.
An invalid value is specified for flags
or addr
and len
; flags
should
be zero since it is for future use only; or addr + len
is less than addr
;
or addr
is not a multiple of the system page size.
Kernel memory is not available.
Part of all of the memory range specified by weights
and weight_count
points
outside the accessible address space.
Memory policy of the memory region is not MPOL_INTERLEAVE_WEIGHT
. Or, memory
policy of the memory region is MPOL_INTERLEAVE_WEIGHT
but also has
MPOL_F_AUTO_WEIGHT
flag.
This system call is for Linux/x86-64 only.
set_mempolicy(2), mbind(2), numa(7), numactl(8)