ia64/linux-2.6.18-xen.hg

view arch/mips/boot/ecoff.h @ 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
children
line source
1 /*
2 * Some ECOFF definitions.
3 */
4 typedef struct filehdr {
5 unsigned short f_magic; /* magic number */
6 unsigned short f_nscns; /* number of sections */
7 long f_timdat; /* time & date stamp */
8 long f_symptr; /* file pointer to symbolic header */
9 long f_nsyms; /* sizeof(symbolic hdr) */
10 unsigned short f_opthdr; /* sizeof(optional hdr) */
11 unsigned short f_flags; /* flags */
12 } FILHDR;
13 #define FILHSZ sizeof(FILHDR)
15 #define OMAGIC 0407
16 #define MIPSEBMAGIC 0x160
17 #define MIPSELMAGIC 0x162
19 typedef struct scnhdr {
20 char s_name[8]; /* section name */
21 long s_paddr; /* physical address, aliased s_nlib */
22 long s_vaddr; /* virtual address */
23 long s_size; /* section size */
24 long s_scnptr; /* file ptr to raw data for section */
25 long s_relptr; /* file ptr to relocation */
26 long s_lnnoptr; /* file ptr to gp histogram */
27 unsigned short s_nreloc; /* number of relocation entries */
28 unsigned short s_nlnno; /* number of gp histogram entries */
29 long s_flags; /* flags */
30 } SCNHDR;
31 #define SCNHSZ sizeof(SCNHDR)
32 #define SCNROUND ((long)16)
34 typedef struct aouthdr {
35 short magic; /* see above */
36 short vstamp; /* version stamp */
37 long tsize; /* text size in bytes, padded to DW bdry*/
38 long dsize; /* initialized data " " */
39 long bsize; /* uninitialized data " " */
40 long entry; /* entry pt. */
41 long text_start; /* base of text used for this file */
42 long data_start; /* base of data used for this file */
43 long bss_start; /* base of bss used for this file */
44 long gprmask; /* general purpose register mask */
45 long cprmask[4]; /* co-processor register masks */
46 long gp_value; /* the gp value used for this object */
47 } AOUTHDR;
48 #define AOUTHSZ sizeof(AOUTHDR)
50 #define OMAGIC 0407
51 #define NMAGIC 0410
52 #define ZMAGIC 0413
53 #define SMAGIC 0411
54 #define LIBMAGIC 0443
56 #define N_TXTOFF(f, a) \
57 ((a).magic == ZMAGIC || (a).magic == LIBMAGIC ? 0 : \
58 ((a).vstamp < 23 ? \
59 ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + 7) & 0xfffffff8) : \
60 ((FILHSZ + AOUTHSZ + (f).f_nscns * SCNHSZ + SCNROUND-1) & ~(SCNROUND-1)) ) )
61 #define N_DATOFF(f, a) \
62 N_TXTOFF(f, a) + (a).tsize;