From b5951f9663cb12953fe3fc249f6ef7dae07e21e1 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Fri, 13 Sep 2013 12:05:50 +0000 Subject: [PATCH] vm: enable filemap=1 by default . turns on mmap() functionality for files by default . also causes exec() to use it to map in executables without copying and with sharing those pages with the disk cache and other instances of the executable Change-Id: Idb94dfe110eed916cf83b12c45e1a77241a2cee5 --- etc/boot.cfg.default | 2 +- servers/vm/main.c | 1 + test/run | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/boot.cfg.default b/etc/boot.cfg.default index 23e805f05..6246aedaa 100644 --- a/etc/boot.cfg.default +++ b/etc/boot.cfg.default @@ -4,6 +4,6 @@ default=2 menu=Start MINIX 3:load_mods /boot/minix_default/mod*;multiboot /boot/minix_default/kernel rootdevname=$rootdevname $args menu=Start latest MINIX 3:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname $args menu=Start latest MINIX 3 in single user mode:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname bootopts=-s $args -menu=Start latest MINIX 3 with file mmap:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname filemap=1 $args +menu=Start latest MINIX 3 without file mmap:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname filemap=0 $args menu=Edit menu option:edit menu=Drop to boot prompt:prompt diff --git a/servers/vm/main.c b/servers/vm/main.c index ed6802762..8b63b6fbb 100644 --- a/servers/vm/main.c +++ b/servers/vm/main.c @@ -322,6 +322,7 @@ void init_vm(void) } /* Turn file mmap on? */ + enable_filemap=1; /* yes by default */ env_parse("filemap", "d", 0, &enable_filemap, 0, 1); /* Sanity check */ diff --git a/test/run b/test/run index ec0b821b0..453126e08 100755 --- a/test/run +++ b/test/run @@ -29,7 +29,12 @@ alltests=" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \ tests_no=`expr 0` # test mmap only if enabled in sysenv +filemap=1 # the default is on if sysenv filemap >/dev/null +then filemap=`sysenv filemap` +fi + +if [ "$filemap" -ne 0 ] then alltests="$alltests 74" fi