⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

NumaTopology

Struct NumaTopology 

Source
pub struct NumaTopology {
    pub node_count: usize,
    pub cpus_per_node: Vec<Vec<CpuId>>,
    pub memory_per_node: Vec<u64>,
    pub distance_matrix: Vec<Vec<u32>>,
}
Expand description

NUMA topology information

Fields§

§node_count: usize

Number of NUMA nodes

§cpus_per_node: Vec<Vec<CpuId>>

CPUs per node

§memory_per_node: Vec<u64>

Memory size per node (in bytes)

§distance_matrix: Vec<Vec<u32>>

Distance matrix (relative latency between nodes)

Implementations§

Source§

impl NumaTopology

Source

pub fn new() -> Self

Create new NUMA topology

Source

pub fn detect() -> Self

Detect NUMA topology from hardware.

Attempts to parse ACPI SRAT/SLIT tables for real multi-node topology. Falls back to a single UMA node if no ACPI tables are available.

Source

pub fn cpu_to_node(&self, cpu: CpuId) -> Option<NodeId>

Get node for a given CPU

Source

pub fn distance(&self, from: NodeId, to: NodeId) -> u32

Get distance between two nodes

Source

pub fn same_node(&self, cpu1: CpuId, cpu2: CpuId) -> bool

Check if two CPUs are on the same node

Trait Implementations§

Source§

impl Clone for NumaTopology

Source§

fn clone(&self) -> NumaTopology

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NumaTopology

Source§

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

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

impl Default for NumaTopology

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl Freeze for NumaTopology

§

impl RefUnwindSafe for NumaTopology

§

impl Send for NumaTopology

§

impl Sync for NumaTopology

§

impl Unpin for NumaTopology

§

impl UnwindSafe for NumaTopology

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.