> nr_node_ids is the possible node number. when we do regular memory online,> it is oline to a possible node, and it is already counted in to nr_node_ids.> > if you increment nr_node_ids dynamically when node online, it causes a lot of> problems. Many data are initialized according to nr_node_ids. That is our> experience when we debug the emulator.>

I think what we'll end up wanting to do is something like this, which adds a numa=possible=<N> parameter for x86; this will add an additional N possible nodes to node_possible_map that we can use to online later. It also adds a new /sys/devices/system/memory/add_node file which takes a typical "size@start" value to hot-add an emulated node. For example, using "mem=2G numa=possible=1" on the command line and doing echo 128M@0x80000000" > /sys/devices/system/memory/add_node would hot-add a node of 128M.Comments?---diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c--- a/arch/x86/mm/numa_64.c+++ b/arch/x86/mm/numa_64.c@@ -33,6 +33,7 @@ s16 apicid_to_node[MAX_LOCAL_APIC] __cpuinitdata = { int numa_off __initdata; static unsigned long __initdata nodemap_addr; static unsigned long __initdata nodemap_size;+static unsigned long __initdata numa_possible_nodes;