Skip to content

Commit

Permalink
sys::man adding MADV_POPULATE_READ and MAP_POPULATE_WRITE.
Browse files Browse the repository at this point in the history
More specialised than MmapFlags::MAP_POPULATE, another difference being
it does not silently fail.

- `MADV_POPULATE_READ` to pre-populate pages ahead of read accesses.
- `MADV_POPULATE_WRITE` to pre-populate pages ahead of subsequent
  writes.
  • Loading branch information
devnexen committed Dec 17, 2024
1 parent 5674377 commit 9debca9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/sys/mman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,13 @@ libc_enum! {
/// Undo `MADV_WIPEONFORK` when it applied.
#[cfg(linux_android)]
MADV_KEEPONFORK,
/// Pre-load the address range for reading to reduce page-fault latency.
#[cfg(linux_android)]
MADV_POPULATE_READ,
/// Pre-fault the address range for writing to reduce page-fault
/// latency on subsequent writes.
#[cfg(linux_android)]
MADV_POPULATE_WRITE,
}
}

Expand Down

0 comments on commit 9debca9

Please sign in to comment.