[][src]Struct dpdk_unix::hyper_thread::HyperThread

pub struct HyperThread(_);

Represents a logical hyper thread, which in Operating System terms is usually a logical CPU (core).

These usually map 1:1 with LogicalCores.

Methods

impl HyperThread[src]

pub fn set_work_queue_hyper_thread_affinity(
    hyper_threads: &BTreeSet<HyperThread>,
    sys_path: &SysPath
) -> Result<()>
[src]

Sets workqueue hyper thread affinity.

pub fn last(hyper_threads: &BTreeSet<HyperThread>) -> Option<&Self>[src]

Last hyper thread.

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

The complement of hyper_threads.

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

Remove as offline hyper_threads.

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

CPUs (hyper threaded logical cores) that are present and that could become online.

Consider using libnuma instead of this call.

See https://www.kernel.org/doc/Documentation/cputopology.txt.

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

Hyper threaded logical cores that are online at some point.

Consider using libnuma instead of this call.

See https://www.kernel.org/doc/Documentation/cputopology.txt.

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

Hyper threaded logical cores that are offline.

The maximum CPU index in this list can exceed the kernel's maximum in self.kernel_maximum_index.

Close to useless.

See https://www.kernel.org/doc/Documentation/cputopology.txt.

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

Hyper threaded logical cores that could possibly be online at some point.

Close to very useless.

See https://www.kernel.org/doc/Documentation/cputopology.txt.

pub fn is_online(self, sys_path: &SysPath) -> bool[src]

pub fn is_offline(self, sys_path: &SysPath) -> bool[src]

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

Disable (offline) this hyper thread.

Requires root.

Hyper thread (CPU) zero (0) is special on x86 / x86-64 and can not ordinarily be offlined.

See https://www.kernel.org/doc/Documentation/core-api/cpu_hotplug.rst.

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

Enable (online) this hyper thread.

Requires root.

See https://www.kernel.org/doc/Documentation/core-api/cpu_hotplug.rst.

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

Hyper threaded logical cores that are siblings of this one.

Will include self.

See https://www.kernel.org/doc/Documentation/cputopology.txt.

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

Hyper threaded logical cores that are hyper-thread-siblings of this one.

Will include self.

Usually wrong on virtual machines (eg Parallels Desktop).

See https://www.kernel.org/doc/Documentation/cputopology.txt.

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

Hyper threaded logical cores grouped as hyper thread groups (eg HT 0 and 1, 2 and 3, etc).

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

Tries to find this hyper thread's NUMA node, if this is a NUMA machine.

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

Hyper threaded logical cores that are thread-siblings of this one according to the level 1 cache.

Will include self.

Usually reliable.

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

Hyper threaded logical cores that are thread-siblings of this one according to the level 1 cache.

Will exclude self.

Usually reliable.

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

Underlying hardware, not Linux, core identifier.

See https://www.kernel.org/doc/Documentation/cputopology.txt.

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

Underlying hardware, not Linux, socket identifier.

See https://www.kernel.org/doc/Documentation/cputopology.txt.

pub fn kernel_maximum_index(sys_path: &SysPath) -> Result<Self>[src]

Simply reports the maximum identifier that could be used by the Linux kernel upto the CONFIG_ number of CPUs.

Add one to this to get the exclusive maximum.

Consider using libnuma instead of this call.

Trait Implementations

impl Default for HyperThread[src]

impl Clone for HyperThread[src]

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

Performs copy-assignment from source. Read more

impl Ord for HyperThread[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 From<u16> for HyperThread[src]

impl Eq for HyperThread[src]

impl Into<u16> for HyperThread[src]

impl Copy for HyperThread[src]

impl PartialOrd<HyperThread> for HyperThread[src]

impl PartialEq<HyperThread> for HyperThread[src]

impl Hash for HyperThread[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

impl Debug for HyperThread[src]

impl<'de> Deserialize<'de> for HyperThread[src]

impl Serialize for HyperThread[src]

Auto Trait Implementations

impl Send for HyperThread

impl Sync for HyperThread

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
    U: Into<T>, 
[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> 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

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

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]