]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: extend memory hotplug API to allow memory hotplug in virtual machines
authorDaniel Kiper <dkiper@net-space.pl>
Tue, 26 Jul 2011 00:12:05 +0000 (17:12 -0700)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 30 Aug 2011 15:31:02 +0000 (11:31 -0400)
commit7ccb5d4261216026c5b633358a9e7355170abf62
tree6819be0e850040eb403dc37e03bffd6bccbdd831
parent77c89e9cd6a375d4df957f6184dfba5a98b4cbbc
mm: extend memory hotplug API to allow memory hotplug in virtual machines

This patch contains online_page_callback and apropriate functions for
registering/unregistering online page callbacks.  It allows to do some
machine specific tasks during online page stage which is required to
implement memory hotplug in virtual machines.  Currently this patch is
required by latest memory hotplug support for Xen balloon driver patch
which will be posted soon.

Additionally, originial online_page() function was splited into
following functions doing "atomic" operations:

  - __online_page_set_limits() - set new limits for memory management code,
  - __online_page_increment_counters() - increment totalram_pages and totalhigh_pages,
  - __online_page_free() - free page to allocator.

It was done to:
  - not duplicate existing code,
  - ease hotplug code devolpment by usage of well defined interface,
  - avoid stupid bugs which are unavoidable when the same code
    (by design) is developed in many places.

[akpm@linux-foundation.org: use explicit indirect-call syntax]
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Reviewed-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>
include/linux/memory_hotplug.h
mm/memory_hotplug.c