[][src]Enum dpdk_unix::memory_information::HugePageSize

#[repr(u64)]
pub enum HugePageSize { _1MB, _2MB, _4MB, _16MB, _256MB, _512MB, _1GB, _2GB, _16GB, }

Commonly supported huge page sizes for modern popular CPU architectures (x86, ARM, PowerPC).

See also https://en.wikipedia.org/wiki/Page_(computer_memory)#Huge_pages.

repr(u64) values are in KiloBytes.

Variants

_1MB

1MB.

_2MB

2MB.

_4MB

4MB.

_16MB

16MB.

_256MB

256MB.

_512MB

512MB.

aarch64 alternative.

_1GB

1GB.

_2GB

2GB.

_16GB

16GB.

Methods

impl HugePageSize
[src]

pub const PotentiallySupportedHugePageSizesLargestFirst: [HugePageSize; 9][src]

Potentially supported huge page sizes.

pub fn size_in_mega_bytes(self) -> u64
[src]

Size in mega bytes.

pub fn size_in_kilo_bytes(self) -> u64
[src]

Size in kilo bytes.

pub fn size_in_bytes(self) -> u64
[src]

Size in bytes.

pub fn calculate_number_of_huge_pages(
    &self,
    desired_number_of_kilo_bytes: u64
) -> u64
[src]

Calculate number of huge pages.

pub fn from_proc_mem_info_value(value: u64) -> Option<Self>
[src]

Converts a value from Linux's /proc/mem pseudo-file into a HugePageSize.

pub fn to_str(&self) -> &'static str
[src]

String description including unit.

pub fn to_bytes(&self) -> &'static [u8]
[src]

String description including unit.

pub fn largest_supported_huge_page_size(sys_path: &SysPath) -> Self
[src]

Supported huge page sizes, sorted smallest to largest.

pub fn supported_huge_page_sizes(sys_path: &SysPath) -> BTreeSet<Self>
[src]

Supported huge page sizes, sorted smallest to largest.

pub fn unreserve_global_huge_pages(self, sys_path: &SysPath) -> Result<()>
[src]

Try to unreserve (clear reservations of) global huge pages.

Will only work as root.

pub fn reserve_global_huge_pages(
    self,
    sys_path: &SysPath,
    number_to_try_to_reserve: u64
) -> Result<()>
[src]

Try to reserve global huge pages.

Will only work as root.

pub fn number_of_global_huge_pages(self, sys_path: &SysPath) -> Result<u64>
[src]

Read number of global huge pages of self size.

pub fn number_of_free_global_huge_pages(self, sys_path: &SysPath) -> Result<u64>
[src]

Read number of free global huge pages of self size.

pub fn number_of_surplus_global_huge_pages(
    self,
    sys_path: &SysPath
) -> Result<u64>
[src]

Read number of surplus global huge pages of self size.

pub fn number_of_reserved_global_huge_pages(
    self,
    sys_path: &SysPath
) -> Result<u64>
[src]

Read number of reserved global huge pages of self size.

pub fn number_of_memory_policy_global_huge_pages(
    self,
    sys_path: &SysPath
) -> Result<u64>
[src]

Read number of memory policy global huge pages of self size.

pub fn number_of_overcommit_global_huge_pages(
    self,
    sys_path: &SysPath
) -> Result<u64>
[src]

Read number of overcommit global huge pages of self size.

pub fn unreserve_numa_huge_pages(
    self,
    sys_path: &SysPath,
    numa_node: u8
) -> Result<()>
[src]

Try to unreserve (clear reservations of) NUMA huge pages.

Will only work as root.

pub fn reserve_numa_huge_pages(
    self,
    sys_path: &SysPath,
    numa_node: u8,
    number_to_try_to_reserve: u64
) -> Result<()>
[src]

Try to reserve NUMA huge pages.

Will only work as root.

pub fn number_of_numa_huge_pages(
    self,
    sys_path: &SysPath,
    numa_node: u8
) -> Result<u64>
[src]

Read number of NUMA huge pages of self size.

This will fail if this is not a NUMA-based machine or the node is not present.

pub fn number_of_free_numa_huge_pages(
    self,
    sys_path: &SysPath,
    numa_node: u8
) -> Result<u64>
[src]

Read number of free NUMA node huge pages of self size.

This will fail if this is not a NUMA-based machine or the node is not present.

pub fn number_of_surplus_numa_huge_pages(
    self,
    sys_path: &SysPath,
    numa_node: u8
) -> Result<u64>
[src]

Read number of surplus NUMA huge pages of self size.

This will fail if this is not a NUMA-based machine or the node is not present.

Trait Implementations

impl Eq for HugePageSize
[src]

impl PartialOrd<HugePageSize> for HugePageSize
[src]

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Copy for HugePageSize
[src]

impl PartialEq<HugePageSize> for HugePageSize
[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for HugePageSize
[src]

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

Performs copy-assignment from source. Read more

impl Ord for HugePageSize
[src]

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

Compares and returns the maximum of two values. Read more

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

Compares and returns the minimum of two values. Read more

impl Debug for HugePageSize
[src]

impl Hash for HugePageSize
[src]

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> From for T
[src]

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

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

type Owned = T

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

type Error = !

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?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

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

The type returned in the event of a conversion error.

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