Skip to content

Commit 02d53a8

Browse files
committed
Set MAP_POPULATE on guest mmap
This directs the Linux kernel to set up page tables eagerly instead of the default lazy behaviour, and shaves about 2 ms off the FreeBSD kernel boot time. Signed-off-by: Colin Percival <cperciva@freebsd.org>
1 parent 9421770 commit 02d53a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/vm-memory/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub fn create_guest_memory(
120120

121121
for region in regions {
122122
let flags = match region.0 {
123-
None => libc::MAP_NORESERVE | libc::MAP_PRIVATE | libc::MAP_ANONYMOUS,
123+
None => libc::MAP_NORESERVE | libc::MAP_POPULATE | libc::MAP_PRIVATE | libc::MAP_ANONYMOUS,
124124
Some(_) => libc::MAP_NORESERVE | libc::MAP_PRIVATE,
125125
};
126126

0 commit comments

Comments
 (0)