view drivers/pci/iomulti.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 8dec4aa9b8b9
line source
1 #ifndef PCI_IOMULTI_H
2 #define PCI_IOMULTI_H
3 /*
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 *
18 * Copyright (c) 2009 Isaku Yamahata
19 * VA Linux Systems Japan K.K.
20 *
21 */
23 struct pci_iomul_setup {
24 uint16_t segment;
25 uint8_t bus;
26 uint8_t dev;
27 uint8_t func;
28 };
30 struct pci_iomul_in {
31 uint8_t bar;
32 uint64_t offset;
34 uint8_t size;
35 uint32_t value;
36 };
38 struct pci_iomul_out {
39 uint8_t bar;
40 uint64_t offset;
42 uint8_t size;
43 uint32_t value;
44 };
46 #define PCI_IOMUL_SETUP _IOW ('P', 0, struct pci_iomul_setup)
47 #define PCI_IOMUL_DISABLE_IO _IO ('P', 1)
48 #define PCI_IOMUL_IN _IOWR('P', 2, struct pci_iomul_in)
49 #define PCI_IOMUL_OUT _IOW ('P', 3, struct pci_iomul_out)
51 #endif /* PCI_IOMULTI_H */