• Yasunori Goto's avatar
    [PATCH] pgdat allocation for new node add (call pgdat allocation) · 9af3c2de
    Yasunori Goto authored
    Add node-hot-add support to add_memory().
    
    node hotadd uses this sequence.
    1. allocate pgdat.
    2. refresh NODE_DATA()
    3. call free_area_init_node() to initialize
    4. create sysfs entry
    5. add memory (old add_memory())
    6. set node online
    7. run kswapd for new node.
    (8). update zonelist after pages are onlined. (This is already merged in -mm
       due to update phase is difference.)
    
    Note:
      To make common function as much as possible,
      there is 2 changes from v2.
        - The old add_memory(), which is defiend by each archs,
          is renamed to arch_add_memory(). New add_memory becomes
          caller of arch dependent function as a common code.
    
        - This patch changes add_memory()'s interface
            From: add_memory(start, end)
            TO  : add_memory(nid, start, end).
          It was cause of similar code that finding node id from
          physical address is inside of old add_memory() on each arch.
    
          In addition, acpi memory hotplug driver can find node id easier.
          In v2, it must walk DSDT'S _CRS by matching physical address to
          get the handle of its memory device, then get _PXM and node id.
          Because input is just physical address.
          However, in v3, the acpi driver can use handle to get _PXM and node id
          for the new memory device. It can pass just node id to add_memory().
    
    Fix interface of arch_add_memory() is in next patche.
    Signed-off-by: default avatarYasunori Goto     <y-goto@jp.fujitsu.com>
    Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Dave Hansen <haveblue@us.ibm.com>
    Cc: "Brown, Len" <len.brown@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    9af3c2de
memory_hotplug.c 5.35 KB