From d615ac4a0ee22ad6b4cfc27e254ef62773b8c056 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Sun, 17 May 2026 08:52:51 -0700 Subject: [PATCH] iter9: 64 MiB chunks on top of iter8 (Phase 2.5 disabled) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit iter8 (Phase 2.5 disabled, 32 MiB chunks) hit 28.7 MB/s mean — 1.3 MB/s below R2 floor. Without Phase 2.5, WAIT_AFTER blocks the mux thread directly once per chunk. Halving the WAIT_AFTER frequency (32 → 64 MiB chunks) should raise the mean without changing the underlying architecture. --- src/io/writeback_file/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/io/writeback_file/mod.rs b/src/io/writeback_file/mod.rs index 424d4ff..b77bc3e 100644 --- a/src/io/writeback_file/mod.rs +++ b/src/io/writeback_file/mod.rs @@ -73,9 +73,14 @@ use std::path::Path; use super::writeback::WritebackPipeline; /// Granularity at which the Linux writeback pipeline issues -/// `sync_file_range` / `posix_fadvise(DONTNEED)` pairs. 32 MiB -/// remains the best-tested value. -const WRITEBACK_CHUNK_BYTES: u64 = 32 * 1024 * 1024; +/// `sync_file_range` / `posix_fadvise(DONTNEED)` pairs. +/// +/// iter9 (2026-05-17): 32 → 64 MiB on top of iter8 (Phase 2.5 +/// disabled). Without Phase 2.5's writer thread, WAIT_AFTER blocks +/// the mux thread directly. Bigger chunks = fewer WAIT_AFTER calls +/// = less mux-thread blocking. iter8 mean was 28.7 with 32 MiB; aim +/// to clear the 30 floor by halving WAIT_AFTER frequency. +const WRITEBACK_CHUNK_BYTES: u64 = 64 * 1024 * 1024; pub(crate) struct WritebackFile { file: File,