view drivers/net/gianfar_mii.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 /*
2 * drivers/net/gianfar_mii.h
3 *
4 * Gianfar Ethernet Driver -- MII Management Bus Implementation
5 * Driver for the MDIO bus controller in the Gianfar register space
6 *
7 * Author: Andy Fleming
8 * Maintainer: Kumar Gala
9 *
10 * Copyright (c) 2002-2004 Freescale Semiconductor, Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 *
17 */
18 #ifndef __GIANFAR_MII_H
19 #define __GIANFAR_MII_H
21 #define MIIMIND_BUSY 0x00000001
22 #define MIIMIND_NOTVALID 0x00000004
24 #define MII_READ_COMMAND 0x00000001
26 #define GFAR_SUPPORTED (SUPPORTED_10baseT_Half \
27 | SUPPORTED_10baseT_Full \
28 | SUPPORTED_100baseT_Half \
29 | SUPPORTED_100baseT_Full \
30 | SUPPORTED_Autoneg \
33 struct gfar_mii {
34 u32 miimcfg; /* 0x.520 - MII Management Config Register */
35 u32 miimcom; /* 0x.524 - MII Management Command Register */
36 u32 miimadd; /* 0x.528 - MII Management Address Register */
37 u32 miimcon; /* 0x.52c - MII Management Control Register */
38 u32 miimstat; /* 0x.530 - MII Management Status Register */
39 u32 miimind; /* 0x.534 - MII Management Indicator Register */
40 };
42 int gfar_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
43 int gfar_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
44 int __init gfar_mdio_init(void);
45 void __exit gfar_mdio_exit(void);
46 #endif /* GIANFAR_PHY_H */