Skip to main content

tree_meta

Function tree_meta 

Source
pub fn tree_meta(generation: u64, nr_nodes: usize, active: u64) -> u64
Expand description

Serialize the committed-tree meta value from its parts.

The bit layout mirrors struct mlfq_tree_ctrl in src/bpf/intf.h: bit 0 the trained bit (always set by a publish), bit 1 the active buffer index, bits 8..31 the node count and bits 32..63 the generation. The active bit is the caller’s decision (the inactive buffer index); the trained bit is constant because this function is only used for a publish.