From 02b568414d509b5d06dbd95bcc0868d487ed359e Mon Sep 17 00:00:00 2001 From: aszlig Date: Sat, 12 Dec 2015 23:40:11 +0100 Subject: 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 --- nixos/modules/testing/test-instrumentation.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nixos/modules/testing/test-instrumentation.nix') diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index f37bbd0246da..c1dbfe305ddd 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 [ ]; -- cgit 1.4.1