Skip to main content

Module numa_alloc

Module numa_alloc 

Source
Expand description

NUMA-Aware Memory Allocation

This module provides NUMA-aware memory allocation for multi-socket systems. Proper NUMA placement can provide 2-4× improvement on multi-socket systems.

§Problem

Default allocators ignore NUMA topology:

  • Memory may be allocated on remote NUMA node
  • Cross-socket access: ~100ns latency vs ~70ns local
  • Bandwidth: ~40GB/s local vs ~20GB/s remote

§Solution

  1. Detect NUMA topology at startup
  2. Allocate memory on specific NUMA nodes
  3. Pre-fault pages to materialize allocations
  4. Pin threads to match memory placement

§Usage

let alloc = NumaAllocator::new()?;
let buffer = alloc.allocate_on_node(1024 * 1024, 0)?; // 1MB on node 0
alloc.prefault(&buffer); // Touch all pages

Structs§

NumaAllocator
NUMA-aware allocator.
NumaBuffer
NUMA-aware memory buffer.
NumaTopology
NUMA topology information.
NumaVectorStorage
NUMA-aware vector storage.
ThreadPinner
Thread pinning utilities.

Enums§

AllocationStrategy
NUMA-local allocation strategy.
NumaError
NUMA allocation errors.

Type Aliases§

NumaNode
NUMA node identifier.
NumaResult
Result type for NUMA operations.