Commit 6a8104b
authored
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 impact1 parent 1411870 commit 6a8104b
1 file changed
Lines changed: 0 additions & 11 deletions
Lines changed: 0 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | 544 | | |
556 | 545 | | |
557 | 546 | | |
| |||
0 commit comments