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

Module numa

Module numa 

Source
Expand description

NUMA-Aware Scheduling

Optimizes process placement for Non-Uniform Memory Access (NUMA) architectures.

§NUMA Background

Modern multi-socket systems have NUMA characteristics where memory access latency depends on which CPU socket is accessing which memory node. Local memory access is faster than remote access (typical ratio: 1.0x vs 1.5-2.0x).

§Optimization Strategy

  1. Memory affinity: Schedule processes on CPUs close to their memory
  2. Load balancing: Balance load within NUMA nodes before cross-node migration
  3. Page migration: Move pages to local node when access patterns change
  4. Interleaving: Distribute memory across nodes for bandwidth-intensive workloads

§ACPI Topology Parsing

On x86_64, NUMA topology is discovered from ACPI tables:

  • SRAT (System Resource Affinity Table): CPU-to-domain and memory-to-domain mappings
  • SLIT (System Locality Information Table): inter-node distance matrix
  • MADT: CPU enumeration including offline CPUs

Structs§

CpuInfo
CPU information from MADT parsing.
NodeLoad
Per-node load statistics
NumaNode
Represents a discovered NUMA node.
NumaScheduler
NUMA scheduler
NumaTopology
NUMA topology information
SlitEntry
Parsed SLIT (System Locality Information Table) data.

Enums§

SratEntry
SRAT sub-table entry types.

Functions§

build_topology
Build a NumaTopology from parsed SRAT and SLIT data.
get_distance
Get the distance between two NUMA nodes from a parsed SLIT entry.
get_numa_scheduler
Get global NUMA scheduler
init
Initialize NUMA-aware scheduling
parse_madt_topology
Parse MADT to extract CPU topology.
parse_slit
Parse the raw SLIT table bytes.
parse_srat
Parse the raw SRAT table bytes into structured entries.

Type Aliases§

CpuId
CPU identifier
NodeId
NUMA node identifier