view usr/Makefile @ 897:329ea0ccb344

balloon: try harder to balloon up under memory pressure.

Currently if the balloon driver is unable to increase the guest's
reservation it assumes the failure was due to reaching its full
allocation, gives up on the ballooning operation and records the limit
it reached as the "hard limit". The driver will not try again until
the target is set again (even to the same value).

However it is possible that ballooning has in fact failed due to
memory pressure in the host and therefore it is desirable to keep
attempting to reach the target in case memory becomes available. The
most likely scenario is that some guests are ballooning down while
others are ballooning up and therefore there is temporary memory
pressure while things stabilise. You would not expect a well behaved
toolstack to ask a domain to balloon to more than its allocation nor
would you expect it to deliberately over-commit memory by setting
balloon targets which exceed the total host memory.

This patch drops the concept of a hard limit and causes the balloon
driver to retry increasing the reservation on a timer in the same
manner as when decreasing the reservation.

Also if we partially succeed in increasing the reservation
(i.e. receive less pages than we asked for) then we may as well keep
those pages rather than returning them to Xen.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 05 14:01:20 2009 +0100 (2009-06-05)
parents 831230e53067
line source
1 #
2 # kbuild file for usr/ - including initramfs image
3 #
5 klibcdirs:;
7 # Generate builtin.o based on initramfs_data.o
8 obj-y := initramfs_data.o
10 # initramfs_data.o contains the initramfs_data.cpio.gz image.
11 # The image is included using .incbin, a dependency which is not
12 # tracked automatically.
13 $(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio.gz FORCE
15 #####
16 # Generate the initramfs cpio archive
18 hostprogs-y := gen_init_cpio
19 initramfs := $(CONFIG_SHELL) $(srctree)/scripts/gen_initramfs_list.sh
20 ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \
22 ramfs-args := \
26 # .initramfs_data.cpio.gz.d is used to identify all files included
27 # in initramfs and to detect if any files are added/removed.
28 # Removed files are identified by directory timestamp being updated
29 # The dependency list is generated by gen_initramfs.sh -l
30 ifneq ($(wildcard $(obj)/.initramfs_data.cpio.gz.d),)
31 include $(obj)/.initramfs_data.cpio.gz.d
32 endif
34 quiet_cmd_initfs = GEN $@
35 cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
37 targets := initramfs_data.cpio.gz
38 # do not try to update files included in initramfs
39 $(deps_initramfs): ;
41 $(deps_initramfs): klibcdirs
42 # We rebuild initramfs_data.cpio.gz if:
43 # 1) Any included file is newer then initramfs_data.cpio.gz
44 # 2) There are changes in which files are included (added or deleted)
45 # 3) If gen_init_cpio are newer than initramfs_data.cpio.gz
46 # 4) arguments to gen_initramfs.sh changes
47 $(obj)/initramfs_data.cpio.gz: $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs
48 $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.gz.d
49 $(call if_changed,initfs)