summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-12-16 17:48:51 +0000
committerAlyssa Ross <hi@alyssa.is>2021-12-17 07:52:11 +0000
commit0acf53bdb19b2fa0cc1bfafd1f16a7405175e961 (patch)
tree45e4e0c280e41d2a2b9f416fb477d681299fa669
parent3ba70f59101b2b0fef637dec3ed15105ebd3418b (diff)
downloadnixpkgs-0acf53bdb19b2fa0cc1bfafd1f16a7405175e961.tar
nixpkgs-0acf53bdb19b2fa0cc1bfafd1f16a7405175e961.tar.gz
nixpkgs-0acf53bdb19b2fa0cc1bfafd1f16a7405175e961.tar.bz2
nixpkgs-0acf53bdb19b2fa0cc1bfafd1f16a7405175e961.tar.lz
nixpkgs-0acf53bdb19b2fa0cc1bfafd1f16a7405175e961.tar.xz
nixpkgs-0acf53bdb19b2fa0cc1bfafd1f16a7405175e961.tar.zst
nixpkgs-0acf53bdb19b2fa0cc1bfafd1f16a7405175e961.zip
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
-rw-r--r--pkgs/build-support/vm/default.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index 20df74d3666..84222eca98b 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