ia64/linux-2.6.18-xen.hg

view drivers/serial/8250.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 * linux/drivers/char/8250.h
3 *
4 * Driver for 8250/16550-type serial ports
5 *
6 * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
7 *
8 * Copyright (C) 2001 Russell King.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $
16 */
18 #include <linux/serial_8250.h>
20 struct old_serial_port {
21 unsigned int uart;
22 unsigned int baud_base;
23 unsigned int port;
24 unsigned int irq;
25 unsigned int flags;
26 unsigned char hub6;
27 unsigned char io_type;
28 unsigned char *iomem_base;
29 unsigned short iomem_reg_shift;
30 };
32 /*
33 * This replaces serial_uart_config in include/linux/serial.h
34 */
35 struct serial8250_config {
36 const char *name;
37 unsigned short fifo_size;
38 unsigned short tx_loadsz;
39 unsigned char fcr;
40 unsigned int flags;
41 };
43 #define UART_CAP_FIFO (1 << 8) /* UART has FIFO */
44 #define UART_CAP_EFR (1 << 9) /* UART has EFR */
45 #define UART_CAP_SLEEP (1 << 10) /* UART has IER sleep */
46 #define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */
47 #define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */
49 #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */
50 #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */
51 #define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */
53 #define PROBE_RSA (1 << 0)
54 #define PROBE_ANY (~0)
56 #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
58 #ifdef CONFIG_SERIAL_8250_SHARE_IRQ
59 #define SERIAL8250_SHARE_IRQS 1
60 #else
61 #define SERIAL8250_SHARE_IRQS 0
62 #endif
64 #if defined(__alpha__) && !defined(CONFIG_PCI)
65 /*
66 * Digital did something really horribly wrong with the OUT1 and OUT2
67 * lines on at least some ALPHA's. The failure mode is that if either
68 * is cleared, the machine locks up with endless interrupts.
69 */
70 #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1)
71 #elif defined(CONFIG_SBC8560)
72 /*
73 * WindRiver did something similarly broken on their SBC8560 board. The
74 * UART tristates its IRQ output while OUT2 is clear, but they pulled
75 * the interrupt line _up_ instead of down, so if we register the IRQ
76 * while the UART is in that state, we die in an IRQ storm. */
77 #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
78 #else
79 #define ALPHA_KLUDGE_MCR 0
80 #endif