libfreemkv: increase DEFAULT_PIPELINE_DEPTH to 32 for smoother mux speed

This commit is contained in:
2026-05-11 22:01:27 -07:00
parent 21a926f32f
commit 0f4a788480
2 changed files with 10 additions and 9 deletions
+8 -7
View File
@@ -49,13 +49,14 @@ use crate::error::Error;
/// Empirically tuned for sweep and mux — both want enough slack that
/// short consumer stalls don't immediately back up onto the producer,
/// but not so much that a producer outpacing the consumer accumulates
/// arbitrary buffered work. `4` matches the depth sweep has used
/// since 0.17.11 (originally in `disc/sweep_pipeline.rs`, now in
/// `disc/sweep.rs::SweepSink`). Patch should usually use
/// [`WRITE_THROUGH_DEPTH`] (`1`) instead — write-through gives clean
/// back-pressure between every read attempt and the matching write,
/// which matters when the consumer is updating the mapfile in lockstep.
pub const DEFAULT_PIPELINE_DEPTH: usize = 4;
/// arbitrary buffered work. `16` matches the depth needed for UHD-scale
/// mux where WritebackFile sync_file_range on NFS can stall the consumer;
/// sweep uses [`DEFAULT_PIPELINE_DEPTH`] directly, mux should use this
/// or deeper if ISO read is moved to a separate producer thread. Patch
/// should usually use [`WRITE_THROUGH_DEPTH`] (`1`) instead — write-through
/// gives clean back-pressure between every read attempt and the matching
/// write, which matters when the consumer is updating the mapfile in lockstep.
pub const DEFAULT_PIPELINE_DEPTH: usize = 32;
/// Channel depth for write-through pipelines. Each `send` fully
/// drains before the next can enqueue. Use this when the producer
+2 -2
View File
@@ -27,7 +27,7 @@ use std::path::Path;
use super::writeback::WritebackPipeline;
const CHUNK_BYTES: u64 = 32 * 1024 * 1024;
const WRITEBACK_CHUNK_BYTES: u64 = 32 * 1024 * 1024;
pub(crate) struct WritebackFile {
file: File,
@@ -42,7 +42,7 @@ impl WritebackFile {
/// or appended files).
pub(crate) fn new(mut file: File) -> io::Result<Self> {
let pos = file.stream_position()?;
let pipeline = WritebackPipeline::new(&file, pos, CHUNK_BYTES);
let pipeline = WritebackPipeline::new(&file, pos, WRITEBACK_CHUNK_BYTES);
Ok(Self {
file,
pipeline,