summary refs log tree commit diff
path: root/gnu/system
diff options
context:
space:
mode:
authorVagrant Cascadian <vagrant@debian.org>2021-04-10 14:49:02 -0700
committerVagrant Cascadian <vagrant@debian.org>2021-04-10 14:49:02 -0700
commit52e3303a144a21dc33d447f1c6412f693ed4e1f1 (patch)
tree1f06b6a8d6a8f43327450ce91071f1bcdf637572 /gnu/system
parent0ba9c3fbf8ed4983d7ff5bb9e82eff8ba8da85e8 (diff)
parent96026bdb8fc3ebcdb4b4144246a1ae8105eefb7c (diff)
downloadguix-52e3303a144a21dc33d447f1c6412f693ed4e1f1.tar.gz
Merge remote-tracking branch 'origin/master' into wip-pinebook-pro
Diffstat (limited to 'gnu/system')
-rw-r--r--gnu/system/vm.scm18
1 files changed, 14 insertions, 4 deletions
diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm
index 3d0935b3af..1efae7ff06 100644
--- a/gnu/system/vm.scm
+++ b/gnu/system/vm.scm
@@ -88,6 +88,13 @@
 ;;;
 ;;; Code:
 
+;; By default, the msize value is 8 KiB, which according to QEMU is
+;; insufficient and would degrade performance.  The msize value should roughly
+;; match the bandwidth of the system's IO (see:
+;; https://wiki.qemu.org/Documentation/9psetup#msize).  Use 100 MiB as a
+;; conservative default.
+(define %default-msize-value (* 100 (expt 2 20))) ;100 MiB
+
 (define %linux-vm-file-systems
   ;; File systems mounted for 'derivation-in-linux-vm'.  These are shared with
   ;; the host over 9p.
@@ -103,21 +110,23 @@
           (type "9p")
           (needed-for-boot? #t)
           (flags '(read-only))
-          (options "trans=virtio,cache=loose")
+          (options (format #f "trans=virtio,cache=loose,msize=~a"
+                           %default-msize-value))
           (check? #f))
         (file-system
           (mount-point "/xchg")
           (device "xchg")
           (type "9p")
           (needed-for-boot? #t)
-          (options "trans=virtio")
+          (options (format #f "trans=virtio,msize=~a" %default-msize-value))
           (check? #f))
         (file-system
           (mount-point "/tmp")
           (device "tmp")
           (type "9p")
           (needed-for-boot? #t)
-          (options "trans=virtio,cache=loose")
+          (options (format #f "trans=virtio,cache=loose,msize=~a"
+                           %default-msize-value))
           (check? #f))))
 
 (define not-config?
@@ -581,7 +590,8 @@ the operating system."
        (type "9p")
        (flags (if writable? '() '(read-only)))
        (options (string-append "trans=virtio"
-                               (if writable? "" ",cache=loose")))
+                               (if writable? "" ",cache=loose")
+                               ",msize=" (number->string %default-msize-value)))
        (check? #f)
        (create-mount-point? #t)))))