Hi Leo!
Leo Famulari <leo@famulari.name> writes:
Toggle quote (17 lines)
> On Tue, Apr 06, 2021 at 05:42:15PM -0400, Maxim Cournoyer wrote:
>> From c720e68229322e5c38c0321b021e8d6430636111 Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>> Date: Tue, 6 Apr 2021 17:37:33 -0400
>> Subject: [PATCH] system: vm: Set a larger value for the msize option of the 9p
>> file system.
>>
>> Fixes <https://issues.guix.gnu.org/47225>.
>>
>> * gnu/system/vm.scm (mapping->file-system): Set the msize option to a value of
>> 100 MiB (from the default 8 KiB).
>>
>> Reported-by: Leo Famulari <leo@famulari.name>
>
> Thanks! I'll test and push along with the next kernel update (that's
> when I noticed this warning). Feel free to push sooner if you like.
I hope I'm timely; I've made a revised version of the patch, that should
cover more cases (and actually uses 100 MiB rather than 1 MiB :-)).
Thank you,
From eb600c4ffbc8016709db9471f9dc0be1d60167a7 Mon Sep 17 00:00:00 2001
file system.
* 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 <leo@famulari.name>
---
gnu/system/vm.scm | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
Toggle diff (57 lines)
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)))))
--
2.31.1
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAmBs//8ACgkQEmDkZILm
NWJu3Q/+OpFYmW1U9vZFwWtEJKh6YAeHF1hBfMkqggTl3ca/FzvDt6NtwHRUwBHK
i7jeY358nyi0ti0zP0zT1btYXXNj5AnjcRpg1LnttOPAaH2bIucjlP1oLYprxRSx
TeZ6Keinp/kpZlrPqANN0bnEu++Y+MvYLDxzyjmeSeTwVENC4siQXvirne0s4uAL
H9+EdvVK7ph5hAhb03aWXeGdYeNsDnuGLNaEzVnXFKec7o10hX1OfM4u8zPRMqZ+
fM+aQrUvrNiI72QIKo5knI19IVRkM3L6MQRUOCH8Hhs2tFH3pp479YQu8AusGGUF
wdcNtG5rPGhEwK2qVvmdKUxoiLFepEgnsEnyK7NHCTsb0+xafuOV95xjQK+95I5S
hLrV9JG8NMo3LBIh+XGbGy4WjX4Qs/EXMpbLdEWzwkfb8l6rykMA4BHSj/avi9NH
xf94V/NUqfZvyJgrP2PvNd6x08BPUgrZpws8Mxj4LCNk96+Nuah/QeVlIwd4D/tW
MiFGX4IJ9qYnOKqV16Dr0oEhXx+8empMyuwKr216dJ76WGyrO+8zwxpgURUdhXjP
g9XixEWMlfzB0mc34Mpwwo2pAX1BdhqCQT7nj3Mt1uk0Qoi0xHvm/3f5p836b7nL
nXzn6/oaBM2NSvJtBI/GApatLgGv7lcBIn6dUBxja38vkZhcx3M=
=xKC5
-----END PGP SIGNATURE-----