#[repr(i32)]
pub enum MemoryBindingPolicy { FirstTouch = 1, Bind = 2, Interleave = 3, NextTouch = 4, }
Expand description

Memory binding policy

Not all systems support all kinds of binding. Topology::feature_support() may be used to query the actual memory binding support in the currently used operating system.

Variants§

§

FirstTouch = 1

Allocate each memory page individually on the local NUMA node of the thread that touches it

The given nodeset should usually be Topology::nodeset() so that the touching thread may run and allocate on any node in the system.

On AIX, if the nodeset is smaller, pages are allocated locally (if the local node is in the nodeset) or from a random non-local node (otherwise).

Requires MemoryBindingSupport::first_touch_policy().

§

Bind = 2

Allocate memory on the specified nodes (most portable option)

The actual behavior may slightly vary between operating systems, especially when (some of) the requested nodes are full. On Linux, by default, the MPOL_PREFERRED_MANY (or MPOL_PREFERRED) policy is used. However, if the STRICT flag is also given, the Linux MPOL_BIND policy is rather used.

Requires MemoryBindingSupport::bind_policy().

§

Interleave = 3

Allocate memory on the given nodes in an interleaved round-robin manner

The precise layout of the memory across multiple NUMA nodes is OS/system specific.

Interleaving can be useful when threads distributed across the specified NUMA nodes will all be accessing the whole memory range concurrently, since the interleave will then balance the memory references.

Requires MemoryBindingSupport::interleave_policy().

§

NextTouch = 4

Migrate pages on next touch

For each page bound with this policy, by next time it is touched (and next time only), it is moved from its current location to the local NUMA node of the thread where the memory reference occurred (if it needs to be moved at all).

Requires MemoryBindingSupport::next_touch_policy().

Trait Implementations§

source§

impl Arbitrary for MemoryBindingPolicy

Available on crate feature proptest only.
§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = Map<Range<usize>, fn(_: usize) -> MemoryBindingPolicy>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
source§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl Clone for MemoryBindingPolicy

source§

fn clone(&self) -> MemoryBindingPolicy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MemoryBindingPolicy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MemoryBindingPolicy

source§

fn default() -> MemoryBindingPolicy

Returns the “default value” for a type. Read more
source§

impl Display for MemoryBindingPolicy

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<MemoryBindingPolicy> for i32

source§

fn from(enum_value: MemoryBindingPolicy) -> Self

Converts to this type from the input type.
source§

impl Hash for MemoryBindingPolicy

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

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

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for MemoryBindingPolicy

source§

fn eq(&self, other: &MemoryBindingPolicy) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Sequence for MemoryBindingPolicy

source§

const CARDINALITY: usize = 4usize

Number of values of type Self. Read more
source§

fn next(&self) -> Option<Self>

Returns value following *self or None if this was the end. Read more
source§

fn previous(&self) -> Option<Self>

Returns value preceding *self or None if this was the beginning. Read more
source§

fn first() -> Option<Self>

Returns the first value of type Self. Read more
source§

fn last() -> Option<Self>

Returns the last value of type Self. Read more
source§

impl TryFrom<i32> for MemoryBindingPolicy

§

type Error = TryFromPrimitiveError<MemoryBindingPolicy>

The type returned in the event of a conversion error.
source§

fn try_from(number: i32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
source§

impl TryFromPrimitive for MemoryBindingPolicy

§

type Primitive = i32

§

type Error = TryFromPrimitiveError<MemoryBindingPolicy>

source§

const NAME: &'static str = "MemoryBindingPolicy"

source§

fn try_from_primitive( number: Self::Primitive ) -> Result<Self, TryFromPrimitiveError<Self>>

source§

impl Copy for MemoryBindingPolicy

source§

impl Eq for MemoryBindingPolicy

source§

impl StructuralPartialEq for MemoryBindingPolicy

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V