New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VM require more memory #2853

Open
marmarek opened this Issue Jun 8, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@marmarek
Member

marmarek commented Jun 8, 2017

Qubes OS version (e.g., R3.2): R4.0

Affected TemplateVMs (e.g., fedora-23, if applicable): fedora-25


When VM is booted as HVM, it very quickly get out of memory in default settings:

  • sys-net with memory=maxmem=300MB is very slow (swapping)
  • other VM with maxmem=4000MB, memory=400MB get oom during startup (fork: Cannot allocate memory on most services, including udev), this happens even before swap is enabled

Increasing memory setting do improve the situation, but also limit number of possible VMs.

@marmarek marmarek added this to the Release 4.0 milestone Jun 8, 2017

@marmarek marmarek self-assigned this Jun 8, 2017

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jun 8, 2017

Member

One thing is that SWIOTLB is enabled, even when no PCI device is assigned (this is Linux default when there is more than 3GB of RAM). This by default use 64MB of physical memory, which cannot be used for anything else. Reducing it to 16MB (default setting on Qubes 3.2) by swiotlb=8192 kernel option improve situation:

  • sys-net use less swap (I'd say it is usable)
  • other VM manage to reach the point where swap is enabled; after full startup about 50MB of swap is used

The results depends on maxmem setting because Linux kernel allocate metadata for all the memory, not only this really usable.

Member

marmarek commented Jun 8, 2017

One thing is that SWIOTLB is enabled, even when no PCI device is assigned (this is Linux default when there is more than 3GB of RAM). This by default use 64MB of physical memory, which cannot be used for anything else. Reducing it to 16MB (default setting on Qubes 3.2) by swiotlb=8192 kernel option improve situation:

  • sys-net use less swap (I'd say it is usable)
  • other VM manage to reach the point where swap is enabled; after full startup about 50MB of swap is used

The results depends on maxmem setting because Linux kernel allocate metadata for all the memory, not only this really usable.

marmarek added a commit to marmarek/qubes-vmm-xen-stubdom-linux that referenced this issue Jun 19, 2017

Set default kernel options for kernel booted from modules.img
If cmdline.txt is absent there, set sensible command line options.
Ideally this should be configurable from dom0, but to some degree it
already is - via cmdline.txt inside modules.img

Set swiotlb=8192 to avoid default 64MB allocation, unused in most VMs.

QubesOS/qubes-issues#2849
QubesOS/qubes-issues#2853

@qubesos-bot qubesos-bot referenced this issue in QubesOS/updates-status Jul 5, 2017

Closed

vmm-xen-stubdom-linux v1.0.1 (r4.0) #108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment