From c4851c0d710c39e54d7ee0b8e522e136f290f09d Mon Sep 17 00:00:00 2001 From: Artturi Date: Wed, 24 Nov 2021 02:33:53 +0200 Subject: [PATCH] Revert msize related commits (#147180) --- nixos/modules/virtualisation/qemu-vm.nix | 2 +- nixos/tests/hibernate.nix | 1 - nixos/tests/installer.nix | 6 +++--- pkgs/build-support/vm/default.nix | 11 ++--------- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 493c407222f7..91356ac1d984 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -306,7 +306,7 @@ in virtualisation.msize = mkOption { type = types.ints.positive; - default = pkgs.vmTools.default9PMsizeBytes; + default = 16384; description = '' The msize (maximum packet size) option passed to 9p file systems, in diff --git a/nixos/tests/hibernate.nix b/nixos/tests/hibernate.nix index fc6857e2fd02..4f05b99a5a11 100644 --- a/nixos/tests/hibernate.nix +++ b/nixos/tests/hibernate.nix @@ -51,7 +51,6 @@ in makeTest { connect-timeout = 1 ''; - virtualisation.memorySize = 2048; virtualisation.diskSize = 8 * 1024; virtualisation.emptyDiskImages = [ # Small root disk for installer diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index 0748a74ee176..513d2506e941 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -76,8 +76,8 @@ let def assemble_qemu_flags(): flags = "-cpu max" ${if (system == "x86_64-linux" || system == "i686-linux") - then ''flags += " -m 1500"'' - else ''flags += " -m 1000 -enable-kvm -machine virt,gic-version=host"'' + then ''flags += " -m 1024"'' + else ''flags += " -m 768 -enable-kvm -machine virt,gic-version=host"'' } return flags @@ -288,7 +288,7 @@ let # builds stuff in the VM, needs more juice virtualisation.diskSize = 8 * 1024; virtualisation.cores = 8; - virtualisation.memorySize = 3096; + virtualisation.memorySize = 1536; # Use a small /dev/vdb as the root disk for the # installer. This ensures the target disk (/dev/vda) is diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 3f176db36c2b..7b517333d9e3 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -110,7 +110,7 @@ rec { echo "mounting Nix store..." mkdir -p /fs${storeDir} - mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose,msize=${toString default9PMsizeBytes} + mount -t 9p store /fs${storeDir} -o trans=virtio,version=9p2000.L,cache=loose mkdir -p /fs/tmp /fs/run /fs/var mount -t tmpfs -o "mode=1777" none /fs/tmp @@ -119,7 +119,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,msize=${toString default9PMsizeBytes} + mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L mkdir -p /fs/proc mount -t proc none /fs/proc @@ -1174,11 +1174,4 @@ rec { `debDistros' sets. */ diskImages = lib.mapAttrs (name: f: f {}) diskImageFuns; - # The default 9P msize value is 8 KiB, which according to QEMU is - # insufficient and would degrade performance. - # See: https://wiki.qemu.org/Documentation/9psetup#msize - # Use 128KiB which is the default in linux 5.15+ - # https://github.com/torvalds/linux/commit/9c4d94dc9a64426d2fa0255097a3a84f6ff2eebe - # TODO: actually set it to 128KiB, it was causing failures in many tests due to memory usage - default9PMsizeBytes = 16 * 1024; }