Remove sequential madvise for compressed blocks in StaticSortedFile (#91263)
## Summary Remove the per-block `madvise(MADV_SEQUENTIAL)` call before decompression in `StaticSortedFile`. The primary motivation is that the kernel splits mmap regions internally when they receive different `madvise` hints. Each per-block `MADV_SEQUENTIAL` call fragments the VMA (Virtual Memory Area) for the file mapping. For larger builds with many compressed blocks, this causes the process to hit the `vm.max_map_count` limit, leading to failures. Additionally, the file-level `MADV_RANDOM` advice is sufficient on its own — the sequential hint for individual compressed blocks adds syscall overhead without meaningful benefit, since the decompressor already performs a linear scan in userspace and the blocks are already mapped in memory. ## Changes - Removed the `madvise(Sequential)` call in `StaticSortedFile::get_block()` for compressed blocks (`turbopack/crates/turbo-persistence/src/static_sorted_file.rs`) ## Test Plan - Existing turbo-persistence tests continue to pass - This is a performance-only change with no functional impact
Showing
Please
register
or
sign in
to comment