]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen/balloon: memory hotplug support for Xen balloon driver
authorDaniel Kiper <dkiper@net-space.pl>
Tue, 26 Jul 2011 00:12:06 +0000 (17:12 -0700)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 30 Aug 2011 15:31:00 +0000 (11:31 -0400)
commit77c89e9cd6a375d4df957f6184dfba5a98b4cbbc
tree75bcb5a581a8e057d40bd94f5f9b8eb56201929f
parent877959753f907e0c2f5eea291e2b652fd1f9ed90
xen/balloon: memory hotplug support for Xen balloon driver

Memory hotplug support for Xen balloon driver.  It should be mentioned
that hotplugged memory is not onlined automatically.  It should be onlined
by user through standard sysfs interface.

Memory could be hotplugged in following steps:

  1) dom0: xl mem-max <domU> <maxmem>
     where <maxmem> is >= requested memory size,

  2) dom0: xl mem-set <domU> <memory>
     where <memory> is requested memory size; alternatively memory
     could be added by writing proper value to
     /sys/devices/system/xen_memory/xen_memory0/target or
     /sys/devices/system/xen_memory/xen_memory0/target_kb on dumU,

  3) domU: for i in /sys/devices/system/memory/memory*/state; do \
             [ "`cat "$i"`" = offline ] && echo online > "$i"; done

Memory could be onlined automatically on domU by adding following line to
udev rules:

  SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"

In that case step 3 should be omitted.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/xen/Kconfig
drivers/xen/balloon.c
include/xen/balloon.h