ia64/linux-2.6.18-xen.hg

view drivers/net/slip.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 * slip.h Define the SLIP device driver interface and constants.
3 *
4 * NOTE: THIS FILE WILL BE MOVED TO THE LINUX INCLUDE DIRECTORY
5 * AS SOON AS POSSIBLE!
6 *
7 * Version: @(#)slip.h 1.2.0 03/28/93
8 *
9 * Fixes:
10 * Alan Cox : Added slip mtu field.
11 * Matt Dillon : Printable slip (borrowed from net2e)
12 * Alan Cox : Added SL_SLIP_LOTS
13 * Dmitry Gorodchanin : A lot of changes in the 'struct slip'
14 * Dmitry Gorodchanin : Added CSLIP statistics.
15 * Stanislav Voronyi : Make line checking as created by
16 * Igor Chechik, RELCOM Corp.
17 * Craig Schlenter : Fixed #define bug that caused
18 * CSLIP telnets to hang in 1.3.61-6
19 *
20 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
21 */
22 #ifndef _LINUX_SLIP_H
23 #define _LINUX_SLIP_H
26 #if defined(CONFIG_INET) && defined(CONFIG_SLIP_COMPRESSED)
27 # define SL_INCLUDE_CSLIP
28 #endif
30 #ifdef SL_INCLUDE_CSLIP
31 # define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
32 #else
33 # define SL_MODE_DEFAULT SL_MODE_SLIP
34 #endif
36 /* SLIP configuration. */
37 #define SL_NRUNIT 256 /* MAX number of SLIP channels;
38 This can be overridden with
39 insmod -oslip_maxdev=nnn */
40 #define SL_MTU 296 /* 296; I am used to 600- FvK */
42 /* SLIP protocol characters. */
43 #define END 0300 /* indicates end of frame */
44 #define ESC 0333 /* indicates byte stuffing */
45 #define ESC_END 0334 /* ESC ESC_END means END 'data' */
46 #define ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */
49 struct slip {
50 int magic;
52 /* Various fields. */
53 struct tty_struct *tty; /* ptr to TTY structure */
54 struct net_device *dev; /* easy for intr handling */
55 spinlock_t lock;
57 #ifdef SL_INCLUDE_CSLIP
58 struct slcompress *slcomp; /* for header compression */
59 unsigned char *cbuff; /* compression buffer */
60 #endif
62 /* These are pointers to the malloc()ed frame buffers. */
63 unsigned char *rbuff; /* receiver buffer */
64 int rcount; /* received chars counter */
65 unsigned char *xbuff; /* transmitter buffer */
66 unsigned char *xhead; /* pointer to next byte to XMIT */
67 int xleft; /* bytes left in XMIT queue */
69 /* SLIP interface statistics. */
70 unsigned long rx_packets; /* inbound frames counter */
71 unsigned long tx_packets; /* outbound frames counter */
72 unsigned long rx_bytes; /* inbound byte counte */
73 unsigned long tx_bytes; /* outbound byte counter */
74 unsigned long rx_errors; /* Parity, etc. errors */
75 unsigned long tx_errors; /* Planned stuff */
76 unsigned long rx_dropped; /* No memory for skb */
77 unsigned long tx_dropped; /* When MTU change */
78 unsigned long rx_over_errors; /* Frame bigger then SLIP buf. */
79 #ifdef SL_INCLUDE_CSLIP
80 unsigned long tx_compressed;
81 unsigned long rx_compressed;
82 unsigned long tx_misses;
83 #endif
84 /* Detailed SLIP statistics. */
86 int mtu; /* Our mtu (to spot changes!) */
87 int buffsize; /* Max buffers sizes */
89 #ifdef CONFIG_SLIP_MODE_SLIP6
90 int xdata, xbits; /* 6 bit slip controls */
91 #endif
93 unsigned long flags; /* Flag values/ mode etc */
94 #define SLF_INUSE 0 /* Channel in use */
95 #define SLF_ESCAPE 1 /* ESC received */
96 #define SLF_ERROR 2 /* Parity, etc. error */
97 #define SLF_KEEPTEST 3 /* Keepalive test flag */
98 #define SLF_OUTWAIT 4 /* is outpacket was flag */
100 unsigned char mode; /* SLIP mode */
101 unsigned char leased;
102 dev_t line;
103 pid_t pid;
104 #define SL_MODE_SLIP 0
105 #define SL_MODE_CSLIP 1
106 #define SL_MODE_SLIP6 2 /* Matt Dillon's printable slip */
107 #define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP)
108 #define SL_MODE_AX25 4
109 #define SL_MODE_ADAPTIVE 8
110 #ifdef CONFIG_SLIP_SMART
111 unsigned char outfill; /* # of sec between outfill packet */
112 unsigned char keepalive; /* keepalive seconds */
113 struct timer_list outfill_timer;
114 struct timer_list keepalive_timer;
115 #endif
116 };
118 #define SLIP_MAGIC 0x5302
120 #endif /* _LINUX_SLIP.H */