From bdc96f6e0e7fbf502f368d3381297ec0b75216d7 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 6 Apr 2021 17:37:33 -0400 Subject: system: vm: Set a larger value for the msize option of the 9p file system. Fixes . * gnu/system/vm.scm (%default-msize-value): New variable. (%linux-vm-file-systems): Use it as the value of the msize option. (mapping->file-system): Likewise. Reported-by: Leo Famulari --- gnu/system/vm.scm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gnu/system') 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))))) -- cgit v1.2.3 From 98bf60bf4ffa14a111bce5265a6299c1bcfd8351 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 12 Apr 2021 14:08:29 +0200 Subject: system: vm: Add a memory-size argument to system-docker-image. * gnu/system/vm.scm (system-docker-image): Add a memory-size argument and pass it to expression->derivation-in-linux-vm. --- gnu/system/vm.scm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnu/system') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 1efae7ff06..97adfa12fa 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -468,6 +468,7 @@ system that is passed to 'populate-root-file-system'." (define* (system-docker-image os #:key (name "guix-docker-image") + (memory-size 256) (register-closures? (has-guix-service-type? os)) shared-network?) "Build a docker image. OS is the desired . NAME is the @@ -561,6 +562,7 @@ the operating system." (expression->derivation-in-linux-vm name build + #:memory-size memory-size #:make-disk-image? #f #:single-file-output? #t #:references-graphs `((,graph ,os))))) -- cgit v1.2.3