nixpkgs-suyu/nixos/modules
aszlig a5bc11f9eb
nixos/vm-tests: Remove msize mount option
This seems to be the root cause of the random page allocation failures
and @wizeman did a very good job on not only finding the root problem
but also giving a detailed explanation of it in #10828.

Here is an excerpt:

  The problem here is that the kernel is trying to allocate a contiguous
  section of 2^7=128 pages, which is 512 KB. This is way too much:
  kernel pages tend to get fragmented over time and kernel developers
  often go to great lengths to try allocating at most only 1 contiguous
  page at a time whenever they can.

  From the error message, it looks like the culprit is unionfs, but this
  is misleading: unionfs is the name of the userspace process that was
  running when the system ran out of memory, but it wasn't unionfs who
  was allocating the memory: it was the kernel; specifically it was the
  v9fs_dir_readdir_dotl() function, which is the code for handling the
  readdir() function in the 9p filesystem (the filesystem that is used
  to share a directory structure between a qemu host and its VM).

  If you look at the code, here's what it's doing at the moment it tries
  to allocate memory:

    buflen = fid->clnt->msize - P9_IOHDRSZ;

    rdir = v9fs_alloc_rdir_buf(file, buflen);

  If you look into v9fs_alloc_rdir_buf(), you will see that it will try
  to allocate a contiguous buffer of memory (using kzalloc(), which is a
  wrapper around kmalloc()) of size buflen + 8 bytes or so.

  So in reality, this code actually allocates a buffer of size
  proportional to fid->clnt->msize. What is this msize? If you follow
  the definition of the structures, you will see that it's the
  negotiated buffer transfer size between 9p client and 9p server. On
  the client side, it can be controlled with the msize mount option.

  What this all means is that, the reason for running out of memory is
  that the code (which we can't easily change) tries to allocate a
  contiguous buffer of size more or less equal to "negotiated 9p
  protocol buffer size", which seems to be way too big (in our NixOS
  tests, at least).

After that initial finding, @lethalman tested the gnome3 gdm test
without setting the msize parameter at all and it seems to have resolved
the problem.

The reason why I'm committing this without testing against all of the
NixOS VM test is basically that I think we can only go better but not
worse than the current state.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-12-14 17:26:24 +01:00
..
config Merge pull request #11628 from grwlf/allproxy 2015-12-11 12:57:36 +01:00
hardware nixos/bumblebee: update for new packages 2015-12-05 00:54:09 +03:00
installer Merge pull request #10586 from dezgeg/pr-arm-tweaks 2015-10-25 04:31:03 +03:00
misc pump.io service: init 2015-12-06 13:35:21 +00:00
profiles Change the preset networking.hostId to use mkDefault so it can be easily changed by the user later 2015-11-22 01:03:16 +11:00
programs zsh module: add /share/zsh to pathsToLink 2015-11-26 04:33:07 +03:00
security nixos/acme: fix timer unit 2015-12-13 17:01:59 +03:00
services Merge pull request #11681 from jgillich/upnpd-fw 2015-12-13 23:03:11 +03:00
system grub: fix typo in variable name (trivial) 2015-12-10 19:52:08 +01:00
tasks nixos/kbd: make systemd-vconsole-setup work with KMS 2015-12-03 22:54:24 +03:00
testing nixos/test-instrumentation: Set vm.min_free_kbytes 2015-12-13 03:18:10 +01:00
virtualisation nixos/vm-tests: Remove msize mount option 2015-12-14 17:26:24 +01:00
module-list.nix Merge branch 'feature/simp_le-service' of https://github.com/mayflower/nixpkgs into mayflower-feature/simp_le-service 2015-12-13 17:01:42 +03:00
rename.nix Factor out option renaming 2015-10-14 18:18:47 +02:00