view drivers/net/hplance.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
line source
1 /* Random defines and structures for the HP Lance driver.
2 * Copyright (C) 05/1998 Peter Maydell <pmaydell@chiark.greenend.org.uk>
3 * Based on the Sun Lance driver and the NetBSD HP Lance driver
4 */
6 /* Registers */
7 #define HPLANCE_ID 0x01 /* DIO register: ID byte */
8 #define HPLANCE_STATUS 0x03 /* DIO register: interrupt enable/status */
10 /* Control and status bits for the status register */
11 #define LE_IE 0x80 /* interrupt enable */
12 #define LE_IR 0x40 /* interrupt requested */
13 #define LE_LOCK 0x08 /* lock status register */
14 #define LE_ACK 0x04 /* ack of lock */
15 #define LE_JAB 0x02 /* loss of tx clock (???) */
16 /* We can also extract the IPL from the status register with the standard
17 * DIO_IPL(hplance) macro, or using dio_scodetoipl()
18 */
20 /* These are the offsets for the DIO regs (hplance_reg), lance_ioreg,
21 * memory and NVRAM:
22 */
23 #define HPLANCE_IDOFF 0 /* board baseaddr */
24 #define HPLANCE_REGOFF 0x4000 /* lance registers */
25 #define HPLANCE_MEMOFF 0x8000 /* struct lance_init_block */
26 #define HPLANCE_NVRAMOFF 0xC008 /* etheraddress as one *nibble* per byte */