ia64/linux-2.6.18-xen.hg

view drivers/atm/nicstarmac.copyright @ 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 /* nicstar.c v0.22 Jawaid Bazyar (bazyar@hypermall.com)
2 * nicstar.c, M. Welsh (matt.welsh@cl.cam.ac.uk)
3 *
4 * Hacked October, 1997 by Jawaid Bazyar, Interlink Advertising Services Inc.
5 * http://www.hypermall.com/
6 * 10/1/97 - commented out CFG_PHYIE bit - we don't care when the PHY
7 * interrupts us (except possibly for removal/insertion of the cable?)
8 * 10/4/97 - began heavy inline documentation of the code. Corrected typos
9 * and spelling mistakes.
10 * 10/5/97 - added code to handle PHY interrupts, disable PHY on
11 * loss of link, and correctly re-enable PHY when link is
12 * re-established. (put back CFG_PHYIE)
13 *
14 * Modified to work with the IDT7721 nicstar -- AAL5 (tested) only.
15 *
16 * R. D. Rechenmacher <ron@fnal.gov>, Aug. 6, 1997 $Revision: 1.1 $ $Date: 1999/08/20 11:00:11 $
17 *
18 * Linux driver for the IDT77201 NICStAR PCI ATM controller.
19 * PHY component is expected to be 155 Mbps S/UNI-Lite or IDT 77155;
20 * see init_nicstar() for PHY initialization to change this. This driver
21 * expects the Linux ATM stack to support scatter-gather lists
22 * (skb->atm.iovcnt != 0) for Rx skb's passed to vcc->push.
23 *
24 * Implementing minimal-copy of received data:
25 * IDT always receives data into a small buffer, then large buffers
26 * as needed. This means that data must always be copied to create
27 * the linear buffer needed by most non-ATM protocol stacks (e.g. IP)
28 * Fix is simple: make large buffers large enough to hold entire
29 * SDU, and leave <small_buffer_data> bytes empty at the start. Then
30 * copy small buffer contents to head of large buffer.
31 * Trick is to avoid fragmenting Linux, due to need for a lot of large
32 * buffers. This is done by 2 things:
33 * 1) skb->destructor / skb->atm.recycle_buffer
34 * combined, allow nicstar_free_rx_skb to be called to
35 * recycle large data buffers
36 * 2) skb_clone of received buffers
37 * See nicstar_free_rx_skb and linearize_buffer for implementation
38 * details.
39 *
40 *
41 *
42 * Copyright (c) 1996 University of Cambridge Computer Laboratory
43 *
44 * This program is free software; you can redistribute it and/or modify
45 * it under the terms of the GNU General Public License as published by
46 * the Free Software Foundation; either version 2 of the License, or
47 * (at your option) any later version.
48 *
49 * This program is distributed in the hope that it will be useful,
50 * but WITHOUT ANY WARRANTY; without even the implied warranty of
51 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52 * GNU General Public License for more details.
53 *
54 * You should have received a copy of the GNU General Public License
55 * along with this program; if not, write to the Free Software
56 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
57 *
58 * M. Welsh, 6 July 1996
59 *
60 *
61 */