view Documentation/spi/butterfly @ 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 spi_butterfly - parport-to-butterfly adapter driver
2 ===================================================
4 This is a hardware and software project that includes building and using
5 a parallel port adapter cable, together with an "AVR Butterfly" to run
6 firmware for user interfacing and/or sensors. A Butterfly is a $US20
7 battery powered card with an AVR microcontroller and lots of goodies:
8 sensors, LCD, flash, toggle stick, and more. You can use AVR-GCC to
9 develop firmware for this, and flash it using this adapter cable.
11 You can make this adapter from an old printer cable and solder things
12 directly to the Butterfly. Or (if you have the parts and skills) you
13 can come up with something fancier, providing ciruit protection to the
14 Butterfly and the printer port, or with a better power supply than two
15 signal pins from the printer port. Or for that matter, you can use
16 similar cables to talk to many AVR boards, even a breadboard.
18 This is more powerful than "ISP programming" cables since it lets kernel
19 SPI protocol drivers interact with the AVR, and could even let the AVR
20 issue interrupts to them. Later, your protocol driver should work
21 easily with a "real SPI controller", instead of this bitbanger.
24 The first cable connections will hook Linux up to one SPI bus, with the
25 AVR and a DataFlash chip; and to the AVR reset line. This is all you
26 need to reflash the firmware, and the pins are the standard Atmel "ISP"
27 connector pins (used also on non-Butterfly AVR boards). On the parport
28 side this is like "sp12" programming cables.
30 Signal Butterfly Parport (DB-25)
31 ------ --------- ---------------
32 SCK = J403.PB1/SCK = pin 2/D0
33 RESET = J403.nRST = pin 3/D1
34 VCC = J403.VCC_EXT = pin 8/D6
35 MOSI = J403.PB2/MOSI = pin 9/D7
36 MISO = J403.PB3/MISO = pin 11/S7,nBUSY
37 GND = J403.GND = pin 23/GND
39 Then to let Linux master that bus to talk to the DataFlash chip, you must
40 (a) flash new firmware that disables SPI (set PRR.2, and disable pullups
41 by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and
42 (c) cable in the chipselect.
44 Signal Butterfly Parport (DB-25)
45 ------ --------- ---------------
46 VCC = J400.VCC_EXT = pin 7/D5
47 SELECT = J400.PB0/nSS = pin 17/C3,nSELECT
48 GND = J400.GND = pin 24/GND
50 Or you could flash firmware making the AVR into an SPI slave (keeping the
51 DataFlash in reset) and tweak the spi_butterfly driver to make it bind to
52 the driver for your custom SPI-based protocol.
54 The "USI" controller, using J405, can also be used for a second SPI bus.
55 That would let you talk to the AVR using custom SPI-with-USI firmware,
56 while letting either Linux or the AVR use the DataFlash. There are plenty
57 of spare parport pins to wire this one up, such as:
59 Signal Butterfly Parport (DB-25)
60 ------ --------- ---------------
61 SCK = J403.PE4/USCK = pin 5/D3
62 MOSI = J403.PE5/DI = pin 6/D4
63 MISO = J403.PE6/DO = pin 12/S5,nPAPEROUT
64 GND = J403.GND = pin 22/GND
66 IRQ = J402.PF4 = pin 10/S6,ACK
67 GND = J402.GND(P2) = pin 25/GND