ia64/linux-2.6.18-xen.hg

view Documentation/nbd.txt @ 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 Network Block Device (TCP version)
3 What is it: With this compiled in the kernel (or as a module), Linux
4 can use a remote server as one of its block devices. So every time
5 the client computer wants to read, e.g., /dev/nb0, it sends a
6 request over TCP to the server, which will reply with the data read.
7 This can be used for stations with low disk space (or even diskless -
8 if you boot from floppy) to borrow disk space from another computer.
9 Unlike NFS, it is possible to put any filesystem on it, etc. It should
10 even be possible to use NBD as a root filesystem (I've never tried),
11 but it requires a user-level program to be in the initrd to start.
12 It also allows you to run block-device in user land (making server
13 and client physically the same computer, communicating using loopback).
15 Current state: It currently works. Network block device is stable.
16 I originally thought that it was impossible to swap over TCP. It
17 turned out not to be true - swapping over TCP now works and seems
18 to be deadlock-free, but it requires heavy patches into Linux's
19 network layer.
21 For more information, or to download the nbd-client and nbd-server
22 tools, go to http://nbd.sf.net/.
24 Howto: To setup nbd, you can simply do the following:
26 First, serve a device or file from a remote server:
28 nbd-server <port-number> <device-or-file-to-serve-to-client>
30 e.g.,
31 root@server1 # nbd-server 1234 /dev/sdb1
33 (serves sdb1 partition on TCP port 1234)
35 Then, on the local (client) system:
37 nbd-client <server-name-or-IP> <server-port-number> /dev/nb[0-n]
39 e.g.,
40 root@client1 # nbd-client server1 1234 /dev/nb0
42 (creates the nb0 device on client1)
44 The nbd kernel module need only be installed on the client
45 system, as the nbd-server is completely in userspace. In fact,
46 the nbd-server has been successfully ported to other operating
47 systems, including Windows.