[][src]Enum context_allocator::memory_sources::mmap::numa::NumaAllocationPolicy

pub enum NumaAllocationPolicy {
    Default,
    Preferred(NumaNodeBitSet),
    Bind(NumaNodeBitSet),
    Interleave(NumaNodeBitSet),
    Local,
}

Defaults to Default.

Ignored on operating systems other than Android and Linux.

Variants

Default

MPOL_DEFAULT.

This mode requests that any non-default policy be removed, restoring default behavior.

When applied to a range of memory this means to use the thread memory policy, which may have been set with the syscall set_mempolicy.

If the mode of the thread memory policy is also NumaNodePolicy::Default, then the system-wide default policy will be used. The system-wide default policy allocates pages on the node of the CPU that triggers the allocation.

Preferred(NumaNodeBitSet)

MPOL_PREFERRED.

This mode sets the preferred node for allocation.

The kernel will try to allocate pages from this node first and fall back to other nodes if the preferred node is low on free memory.

The first node in the bit set will be selected as the preferred node. If the NUMA node bit set is empty, then the memory is allocated on the node of the CPU that triggered the allocation.

Bind(NumaNodeBitSet)

MPOL_BIND.

This mode specifies a strict policy that restricts memory allocation to the nodes specified in nodemask.

Page allocations will come from the node in the NUMA node node bit set with sufficient free memory that is closest to the node where the allocation takes place. Pages will not be allocated from any node not specified in the NUMA node node bit set.

Interleave(NumaNodeBitSet)

MPOL_INTERLEAVE.

This mode specifies that page allocations be interleaved across the set of nodes specified in the NUMA node bit set.

This optimizes for bandwidth instead of latency by spreading out pages and memory accesses to those pages across multiple nodes. To be effective the memory area should be fairly large, at least 1 MB or bigger with a fairly uniform access pattern. Accesses to a single page of the area will still be limited to the memory bandwidth of a single node.

Local

MPOL_LOCAL.

This mode specifies "local allocation"; the memory is allocated on the node of the CPU that triggered the allocation (the "local node").

If the "local node" is low on free memory, the kernel will try to allocate memory from other nodes. The kernel will allocate memory from the "local node" whenever memory for this node is available. If the "local node" is not allowed by the thread's current cpuset context, the kernel will try to allocate memory from other nodes. The kernel will allocate memory from the "local node" whenever it becomes allowed by the thread's current cpuset context.

Since Linux 3.8.

Trait Implementations

impl Eq for NumaAllocationPolicy[src]

impl Copy for NumaAllocationPolicy[src]

impl PartialOrd<NumaAllocationPolicy> for NumaAllocationPolicy[src]

impl PartialEq<NumaAllocationPolicy> for NumaAllocationPolicy[src]

impl Clone for NumaAllocationPolicy[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for NumaAllocationPolicy[src]

impl Ord for NumaAllocationPolicy[src]

default fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

default fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

default fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl Debug for NumaAllocationPolicy[src]

impl Hash for NumaAllocationPolicy[src]

default fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.