mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +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>
Xen Control Tools - Examples
===================================
This directory contains example scripts and configurations for Xen.
For many operations you will either be able to use these scripts directly, or
incorporate code from them into your own scripts.
If you write a useful script and would like to share it, please do
send it (preferably with a little summary to go in this file) to
<xen-devel@lists.sourceforge.net> so we can add it to this directory.
block - called by xen-backend.agent to bind/unbind dev
block-common.sh - sourced by block, block-*
block-enbd - binds/unbinds network block devices
block-nbd - binds/unbinds network block devices
cpupool - example configuration script for 'xm cpupool-create'
external-device-migrate - called by xend for migrating external devices
locking.sh - locking functions to prevent concurrent access to
critical sections inside script files
logging.sh - logging function to log output using syslog
network-bridge - xen network start/stop script when using bridging
network-nat - xen network start/stop script when using NAT
network-route - xen network start/stop script when using routing
vif-bridge - virtual network start/stop script in bridged mode
vif-common.sh - sourced by vif-bridge
vif-nat - xen virtual network start/stop script in NAT mode
vif-route - xen virtual network start/stop script in routed mode
xen-backend.agent - calls block, vif-* scripts to add, remove, hotplug
devices
xen-backend.rules - hotplug script rules
xend-config.sxp - default xend configuration file
xen-hotplug-common.sh - sourced by vif-common.sh
xen-network-common.sh - sourced by vif-common.sh
xen-script-common.sh - sourced by network-bridge, xen-hotplug-common.sh
xmexample1 - example configuration script for 'xm create'
xmexample2 - a more complex configuration script for 'xm create'
xmexample3 - an advanced configuration script for 'xm create'
that utilizes the vmid
xmexample.nbd - configuration script that uses NBD filesystems
xmexample.hvm - a configuration script for creating a hvm domain with
'xm create'
xmexample.hvm-stubdom - a configuration script for creating a hvm domain with
'xm create' that utilizes a stubdomain for device model
xmexample.pv-grub - a configuration script for creating a domain with 'xm create'
which boots PV-GRUB.
xmexample.vti - a configuration script for creating a domain on vti