From bbd03e236a58e9344c91861513699e070186a3c5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 29 Dec 2016 21:23:21 +0100 Subject: [PATCH] Use looser 9pfs caching in VM tests/builds This can give significant speed ups, see https://github.com/edolstra/linux/commit/7e20254412c780a2102761fee92cb1d32ceeaefd. --- nixos/modules/virtualisation/qemu-vm.nix | 4 ++-- pkgs/build-support/vm/default.nix | 4 ++-- pkgs/os-specific/linux/kernel/patches.nix | 9 +++++++++ pkgs/top-level/all-packages.nix | 1 + 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 041c7dbec70..586f5d9c0a3 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -440,13 +440,13 @@ in ${if cfg.writableStore then "/nix/.ro-store" else "/nix/store"} = { device = "store"; fsType = "9p"; - options = [ "trans=virtio" "version=9p2000.L" "cache=loose" ]; + options = [ "trans=virtio" "version=9p2000.L" "veryloose" ]; neededForBoot = true; }; "/tmp/xchg" = { device = "xchg"; fsType = "9p"; - options = [ "trans=virtio" "version=9p2000.L" "cache=loose" ]; + options = [ "trans=virtio" "version=9p2000.L" "veryloose" ]; neededForBoot = true; }; "/tmp/shared" = diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 47f61ab64d6..d03265c089a 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -130,7 +130,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,veryloose mkdir -p /fs/tmp /fs/run /fs/var mount -t tmpfs -o "mode=1777" none /fs/tmp @@ -139,7 +139,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,cache=loose + mount -t 9p xchg /fs/tmp/xchg -o trans=virtio,version=9p2000.L,veryloose mkdir -p /fs/proc mount -t proc none /fs/proc diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 1ad1155f8c3..68117e14181 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -175,4 +175,13 @@ rec { }; }; + p9_caching_4_4 = rec + { name = "9p-caching.patch"; + patch = fetchpatch { + inherit name; + url = https://github.com/edolstra/linux/commit/d522582553368b9564e2d88a8d7b1d469bf98c65.patch; + sha256 = "01h7461pdgavd6ghd6w9wg136hkaca0mrmmzhy6s3phksksimbc2"; + }; + }; + } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 45da2f10e82..d9842aaede3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11069,6 +11069,7 @@ in kernelPatches = [ kernelPatches.bridge_stp_helper kernelPatches.cpu-cgroup-v2."4.4" + kernelPatches.p9_caching_4_4 ] ++ lib.optionals ((platform.kernelArch or null) == "mips") [ kernelPatches.mips_fpureg_emu