Module backend

Module backend 

Source
Expand description

2026-09-25: The StorageBackend trait, which moves KV groups and blocks between a storage tier and device memory, and the two file backends.

Owner: metrale-storage high-speed swap. Invariants:

  • A backend that keeps the default read_blocks issues, for each block, the per-head reads of expand_blocks_to_groups, in that order (pinned by mod_tests.rs).

Re-exports§

pub use self::io_uring::IoUringBackend;
pub use posix::PosixBackend;

Modules§

io_uring
2026-09-25: The Linux file backend: io_uring fixed-buffer reads (SQPOLL, registered pinned buffers) into qd bounce buffers, each copied to the device on the caller’s stream.
posix
2026-09-25: The portable file backend: one pinned bounce buffer, a positional read through crate::tier::pio (pread/pwrite on unix, seek_read/seek_write on Windows) and a host-to-device copy per group. HighSpeedSwap uses it on every target but Linux.

Structs§

BlockReadRequest
2026-09-25: Read one whole block (block_bytes(): every kv_head’s K, then every V) into device memory starting at dst_dev_ptr. Only base_key’s layer and block are read.
ReadRequest
2026-09-25: Read group from the tier into device memory at dst_dev_ptr.

Traits§

StorageBackend

Functions§

expand_blocks_to_groups
2026-09-25: Expand each block request into its 2·nkv per-head requests, ordered K(kh), V(kh) for kh in 0..nkv, with device destinations dst + kh·gs (K) and dst + (nkv + kh)·gs (V). The default read_blocks and read_blocks_async fan out through it.