annotate arch/mips/pci/fixup-ocelot-c.c @ 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
rev   line source
ian@0 1 /*
ian@0 2 * Copyright 2002 Momentum Computer Inc.
ian@0 3 * Author: Matthew Dharm <mdharm@momenco.com>
ian@0 4 *
ian@0 5 * Based on work for the Linux port to the Ocelot board, which is
ian@0 6 * Copyright 2001 MontaVista Software Inc.
ian@0 7 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
ian@0 8 *
ian@0 9 * arch/mips/momentum/ocelot_g/pci.c
ian@0 10 * Board-specific PCI routines for mv64340 controller.
ian@0 11 *
ian@0 12 * This program is free software; you can redistribute it and/or modify it
ian@0 13 * under the terms of the GNU General Public License as published by the
ian@0 14 * Free Software Foundation; either version 2 of the License, or (at your
ian@0 15 * option) any later version.
ian@0 16 */
ian@0 17 #include <linux/types.h>
ian@0 18 #include <linux/pci.h>
ian@0 19 #include <linux/kernel.h>
ian@0 20 #include <linux/init.h>
ian@0 21
ian@0 22 int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
ian@0 23 {
ian@0 24 int bus = dev->bus->number;
ian@0 25
ian@0 26 if (bus == 0 && slot == 1)
ian@0 27 return 2; /* PCI-X A */
ian@0 28 if (bus == 1 && slot == 1)
ian@0 29 return 12; /* PCI-X B */
ian@0 30 if (bus == 1 && slot == 2)
ian@0 31 return 4; /* PCI B */
ian@0 32
ian@0 33 return 0;
ian@0 34 panic("Whooops in pcibios_map_irq");
ian@0 35 }
ian@0 36
ian@0 37 /* Do platform specific device initialization at pci_enable_device() time */
ian@0 38 int pcibios_plat_dev_init(struct pci_dev *dev)
ian@0 39 {
ian@0 40 return 0;
ian@0 41 }