pub struct PipeBufferConfig {
pub num_pipes: usize,
pub min_write_size: usize,
pub max_write_size: usize,
pub non_blocking: bool,
}Expand description
Configuration for pipe buffer entropy collection.
§Example
let config = PipeBufferConfig {
num_pipes: 8, // more pipes = more zone contention
min_write_size: 64, // skip tiny writes
max_write_size: 2048, // cap at 2KB
non_blocking: true, // capture EAGAIN timing (recommended)
};Fields§
§num_pipes: usizeNumber of pipes to use simultaneously.
Multiple pipes competing for kernel buffer space creates zone allocator contention. Each pipe is allocated from the kernel’s pipe zone, and cross-CPU magazine transfers add nondeterminism.
Range: 1+ (clamped to >=1). Default: 4
min_write_size: usizeMinimum write size in bytes.
Small writes use inline pipe buffer storage; larger writes chain mbufs. The transition between these paths adds entropy.
Range: 1+. Default: 1
max_write_size: usizeMaximum write size in bytes.
Larger writes exercise different mbuf allocation paths and are more likely to trigger cross-CPU magazine transfers in the zone allocator.
Range: >= min_write_size. Default: 4096
non_blocking: boolUse non-blocking mode for pipe writes.
Non-blocking writes that hit EAGAIN (pipe buffer full) follow a
different kernel path than blocking writes. The timing of the failure
check is itself a source of entropy.
Default: true
Trait Implementations§
Source§impl Clone for PipeBufferConfig
impl Clone for PipeBufferConfig
Source§fn clone(&self) -> PipeBufferConfig
fn clone(&self) -> PipeBufferConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more