From 0acf53bdb19b2fa0cc1bfafd1f16a7405175e961 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 16 Dec 2021 17:48:51 +0000 Subject: [PATCH] runInLinuxVM: set 9p msize to 128K This fixes the following warning from QEMU, by using the value that will be the default in newer kernels[1]. > 9p: degraded performance: a reasonable high msize should be chosen > on client/guest side (chosen msize is <= 8192). See > https://wiki.qemu.org/Documentation/9psetup#msize for details. For a runInLinuxVM derivation I have that does a large amount of IO[2], this change results in a fairly small but repeatable speed increase. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9c4d94dc9a64426d2fa0255097a3a84f6ff2eebe [2]: https://spectrum-os.org/git/spectrum/tree/installer/default.nix?id=06dd70500a9e475d23e3296dddf409d84abf9b9c#n52 --- pkgs/build-support/vm/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 20df74d3666d..84222eca98bf 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -114,7 +114,7 @@ rec { echo "mounting Nix store..." mkdir -p /fs${storeDir} - mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose + mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose,msize=131072 mkdir -p /fs/tmp /fs/run /fs/var mount -t tmpfs -o "mode=1777" none /fs/tmp @@ -123,7 +123,7 @@ rec { echo "mounting host's temporary directory..." mkdir -p /fs/tmp/xchg - mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L + mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L,msize=131072 mkdir -p /fs/proc mount -t proc none /fs/proc