summary refs log tree commit diff
path: root/nixos/modules/testing/test-instrumentation.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-12-12 23:40:11 +0100
committeraszlig <aszlig@redmoonstudios.org>2015-12-13 03:18:10 +0100
commit02b568414d509b5d06dbd95bcc0868d487ed359e (patch)
treec5d8cc80c4a985351b1427a887aaa74ab11c2f52 /nixos/modules/testing/test-instrumentation.nix
parent53979b54a8e1581069bf8fe4f8497e8c3225d946 (diff)
downloadnixpkgs-02b568414d509b5d06dbd95bcc0868d487ed359e.tar
nixpkgs-02b568414d509b5d06dbd95bcc0868d487ed359e.tar.gz
nixpkgs-02b568414d509b5d06dbd95bcc0868d487ed359e.tar.bz2
nixpkgs-02b568414d509b5d06dbd95bcc0868d487ed359e.tar.lz
nixpkgs-02b568414d509b5d06dbd95bcc0868d487ed359e.tar.xz
nixpkgs-02b568414d509b5d06dbd95bcc0868d487ed359e.tar.zst
nixpkgs-02b568414d509b5d06dbd95bcc0868d487ed359e.zip
nixos/test-instrumentation: Set vm.min_free_kbytes
We hit page allocation failures a lot at random for VM tests, in case of
my own Hydra when it comes to the installer tests. The reason for this
is that once the memory of the VM gets heavily fragmented the kernel is
unable to allocate new pages.

Setting vm.min_free_kbytes to 16MB forces the kernel to keep a minimum
of 16 MB free.

I've done some testing accross repeated runs of the installer tests with
and without vm.min_free_kbytes set. So accross 30 test runs for each
settings, all of the tests with the option being set passed while 14
tests without that sysctl option triggered page allocation failures.

Sure, running 30 tests is not a guarantee that 16MB is enough, but we'll
see how it turns out in the long run across all VM tests.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'nixos/modules/testing/test-instrumentation.nix')
-rw-r--r--nixos/modules/testing/test-instrumentation.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix
index f37bbd0246d..c1dbfe305dd 100644
--- a/nixos/modules/testing/test-instrumentation.nix
+++ b/nixos/modules/testing/test-instrumentation.nix
@@ -88,6 +88,10 @@ let kernel = config.boot.kernelPackages.kernel; in
 
     boot.consoleLogLevel = 7;
 
+    # Make sure we don't hit page allocation failures if the VM's memory is
+    # heavily fragmented.
+    boot.kernel.sysctl."vm.min_free_kbytes" = 16384;
+
     # Prevent tests from accessing the Internet.
     networking.defaultGateway = mkOverride 150 "";
     networking.nameservers = mkOverride 150 [ ];