mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
The XENMEM_claim_pages hypercall operates per domain and it should be
used system wide. As such this patch introduces a global configuration
option 'claim_mode' that by default is disabled.
If this option is enabled then when a guest is created there will be an
guarantee that there is memory available for the guest. This is an
particularly acute problem on hosts with memory over-provisioned guests
that use tmem and have self-balloon enabled (which is the default option
for them). The self-balloon mechanism can deflate/inflate the balloon
quickly and the amount of free memory (which 'xl info' can show) is stale
the moment it is printed. When claim is enabled a reservation for the
amount of memory ('memory' in guest config) is set, which is then reduced
as the domain's memory is populated and eventually reaches zero.
If the reservation cannot be meet the guest creation fails immediately
instead of taking seconds/minutes (depending on the size of the guest)
while the guest is populated.
Note that to enable tmem type guests, one needs to provide 'tmem' on the
Xen hypervisor argument and as well on the Linux kernel command line.
There are two boolean options:
(0) No claim is made. Memory population during guest creation will be
attempted as normal and may fail due to memory exhaustion.
(1) Normal memory and freeable pool of ephemeral pages (tmem) is used when
calculating whether there is enough memory free to launch a guest.
This guarantees immediate feedback whether the guest can be launched due
to memory exhaustion (which can take a long time to find out if launching
massively huge guests) and in parallel.
[v1: Removed own claim_mode type, using just bool, improved docs, all per
Ian's suggestion]
[v2: Updated the comments]
[v3: Rebase on top 733b9c524d (xl: add vif.default.script)]
[v4: Fixed up comments]
[v5: s/global_claim_mode/claim_mode/]
[v6: Ian Jackson's feedback: use libxl_defbool, better comments, etc]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
## Global XL config file ##
|
|
|
|
# Control whether dom0 is ballooned down when xen doesn't have enough
|
|
# free memory to create a domain. "auto" means only balloon if dom0
|
|
# starts with all the host's memory.
|
|
#autoballoon="auto"
|
|
|
|
# full path of the lockfile used by xl during domain creation
|
|
#lockfile="/var/lock/xl"
|
|
|
|
# default vif script
|
|
#vifscript="vif-bridge"
|
|
|
|
# default output format used by "xl list -l"
|
|
#output_format="json"
|
|
|
|
# first block device to be used for temporary VM disk mounts
|
|
#blkdev_start="xvda"
|
|
|
|
# default option to run hotplug scripts from xl
|
|
# if disabled the old behaviour will be used, and hotplug scripts will be
|
|
# launched by udev.
|
|
#run_hotplug_scripts=1
|
|
|
|
# default gateway device to use with vif-route hotplug script
|
|
#vif.default.gatewaydev="eth0"
|
|
|
|
# default bridge device to use with vif-bridge hotplug scripts
|
|
#vif.default.bridge="xenbr0"
|
|
|
|
# Reserve a claim of memory when launching a guest. This guarantees immediate
|
|
# feedback whether the guest can be launched due to memory exhaustion
|
|
# (which can take a long time to find out if launching huge guests).
|
|
# see xl.conf(5) for details.
|
|
#claim_mode=0
|