• Daniel Kiper's avatar
    mm: extend memory hotplug API to allow memory hotplug in virtual machines · 9d0ad8ca
    Daniel Kiper authored
    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: default avatarDaniel Kiper <dkiper@net-space.pl>
    Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Jeremy Fitzhardinge <jeremy@goop.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    9d0ad8ca
memory_hotplug.c 23.9 KB