Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upInitial memory assignment strategy leads to PoD exhaustion (crashes domains without memory balloon drivers) #4135
Comments
jpouellet
changed the title from
Xen config generation allows PoD exhaustion (crashes domains without memory balloon drivers)
to
Initial memory assignment strategy leads to PoD exhaustion (crashes domains without memory balloon drivers)
Jul 24, 2018
andrewdavidwong
added
bug
C: core
labels
Jul 25, 2018
andrewdavidwong
added this to the Release 4.0 updates milestone
Jul 25, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jpouellet commentedJul 24, 2018
When qvm-prefs
memory!=maxmem(domain xmlcurrentMemory!=memory), Xen advertises maxmem existing memory to the guest, but only allocates / assigns enough mfns for currentMemory backing pages. The difference is made up by a pool of "Populate on Demand" pages. More info at: https://blog.xenproject.org/2014/02/14/ballooning-rebooting-and-the-feature-youve-never-heard-of/This has an implicit assumption that whenever memory != maxmem, your guest actually supports memory ballooning and will initialize the memory balloon driver and reserve
maxmem - memoryamount of memory to not be used by the guest. If this is not the case (e.g., if your operating system does not support Xen memory ballooning), then if maxmem > memory you inevitably run out of PoD pages and the guest crashes:Unselecting "Include in memory balancing" in qubes-vm-settings greys out the maxmem UI and excludes the domain from qmemman balancing, but still reports whatever maxmem value was set previously, resulting in crashes.
One possible solution (which creates potentially undesired coupling between prefs and services) is: if "Include in memory balancing" is unselected (qvm-service meminfo-writer off), then the
memorydomain xml value be set to thememory(instead ofmaxmem) qvm-pref (as we currently do for VMs w/ PCI devices), or potentially thecurrentMemorydomain xml value could be omitted entirely.Relevant libvirt docs for memory config at: https://libvirt.org/formatdomain.html#elementsMemoryAllocation
Relevant libvirt xml template code in core-admin at: https://github.com/QubesOS/qubes-core-admin/blob/c3d287a33cc0cf5c2038e715eb4da66d78d2703d/templates/libvirt/xen.xml#L5-L10
If anyone wants to reproduce, OpenBSD is one such OS which does not (yet) support Xen memory ballooning.
Workaround: simply set memory and maxmem prefs to the same value.