From ef75affbab846b099993779a72db0bf3396cd0be Mon Sep 17 00:00:00 2001 From: Eric Ernst Date: Mon, 28 Aug 2017 13:01:35 -0700 Subject: [PATCH] agent: update 9p mount syscall so mmap is rw By default the mmap command for 9p is read only Reason: generic_file_readonly_mmap is used by 9pfs Kernel side client code in case there is no caching. Based on this, we should enable caching for our 9p mounts. There are two verified options for this: 1. cache=fscache 2. cache=mmap After running FIO tests (random and linear read/write i/o), I see mmap providing slightly better performance, and it does not require any additional kernel config options to be enabled. Currently the value of cache=none (the default for mount). Enabling caching gives performance that is on parity with no caching, and slight improvements for random write IO. Fixes #92. Signed-off-by: Eric Ernst --- syscall.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/syscall.go b/syscall.go index b7e707479..ed5a4066e 100644 --- a/syscall.go +++ b/syscall.go @@ -103,7 +103,8 @@ func mountShareDir(tag string) error { return err } - return syscall.Mount(tag, mountShareDirDest, type9pFs, syscall.MS_MGC_VAL|syscall.MS_NODEV, "trans=virtio") + return syscall.Mount(tag, mountShareDirDest, type9pFs, syscall.MS_MGC_VAL|syscall.MS_NODEV, "trans=virtio,version=9p2000.L,posixacl,cache=mmap") + } func unmountShareDir() error {