nixpkgs/nixos/modules/virtualisation
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
..
amazon-grow-partition.nix Wait for udev after resizing partitions 2015-09-28 22:15:47 +02:00
amazon-image.nix Blacklist the xen_fbfront kernel module 2015-09-28 22:15:47 +02:00
amazon-init.nix Remove option ec2.metadata 2015-06-30 17:25:56 +02:00
amazon-options.nix Move amazon option out of amazon-image.nix, needed to make ec2.hvm usable from nixops, without breaking evaluation for other backends. 2015-02-16 09:57:19 +00:00
azure-agent.nix Azure image: package and add azure agent 2015-12-09 07:42:37 +02:00
azure-common.nix Azure image: package and add azure agent 2015-12-09 07:42:37 +02:00
azure-config.nix Initial configuration + image generation script for Micro$oft Azure. Work in progress for #3986. 2014-09-06 21:37:46 +02:00
azure-image.nix Azure image: update ssh key type, start before the Azure agent 2015-12-09 07:42:37 +02:00
brightbox-config.nix Add initial Brightbox expression. 2015-08-08 19:50:22 +00:00
brightbox-image.nix nixos: rename some outputs for better discoverability in /nix/store 2015-09-18 19:00:20 +00:00
container-config.nix Use ConditionVirtualization to disable some services in containers 2015-07-22 12:23:40 +02:00
containers.nix Merge branch 'master' into extra-binds 2015-09-28 06:02:52 +00:00
docker-image.nix container.nix -> docker-container.nix 2015-04-19 22:06:45 +02:00
docker.nix nixos/docker: enable socketActivation by default 2015-11-20 23:01:59 +01:00
ec2-data.nix ec2-data.nix: Remove superfluous check 2015-09-28 13:47:14 +02:00
google-compute-config.nix Work around infinite recursion issue in nixops. 2015-04-29 09:55:20 +00:00
google-compute-image.nix nixos: rename some outputs for better discoverability in /nix/store 2015-09-18 19:00:20 +00:00
growpart-util-linux-2.26.patch Update AMI generator 2015-09-27 21:06:40 +02:00
libvirtd.nix nixos/libvirtd: remove --verbose flag 2015-05-20 12:14:18 +02:00
lxc-container.nix container.nix -> docker-container.nix 2015-04-19 22:06:45 +02:00
lxc.nix nixos: citerefentry markup in lxc option descriptions 2015-02-28 09:21:48 +01:00
lxd.nix nixos/lxd: Add service 2015-09-13 23:27:31 -07:00
nixos-container-completion.sh nixos-container: Add bash completion for "nixos-container" command 2015-09-16 22:18:48 +02:00
nixos-container.pl nixos-container: Fix show-host-key 2015-09-08 15:57:49 +02:00
nova-image.nix nova-image: don't use ec2-data since it delays the bootup time 2015-12-03 11:10:32 +01:00
nova.nix nixos: Replace pkgs.openssh with config.programs.ssh.package 2015-06-26 17:09:58 -07:00
openvswitch.nix Revert "openvswitch module: do not fork services" 2015-09-24 14:58:31 +02:00
parallels-guest.nix "Parallel Tools" -> Parallels Tools 2015-09-15 08:51:02 +02:00
qemu-opts Move all of NixOS to nixos/ in preparation of the repository merge 2013-10-10 13:28:20 +02:00
qemu-vm.nix nixos/vm-tests: Remove msize mount option 2015-12-14 17:26:24 +01:00
rkt.nix rkt: add service 2015-12-11 05:53:20 +01:00
virtualbox-guest.nix virtualbox service: add support for vboxsf guest filesystem 2015-09-21 22:32:13 +02:00
virtualbox-host.nix virtualbox service: hide vboxnet0 from NetworkManager, fixes #10862 2015-11-10 12:21:35 +01:00
virtualbox-image.nix Use make-disk-image.nix for VirtualBox images 2015-09-28 14:31:19 +02:00
vmware-guest.nix fix argument in mkEnableOption 2015-06-21 18:21:21 +03:00
xen-dom0.nix xen: fixes (authored by michalpalka) 2015-07-15 12:38:37 +02:00
xen-domU.nix Update: add new Xen versions + update NixOS Xen modules 2015-02-25 23:30:44 +01:00