Re: [7/7,v8] NUMA Hotplug Emulator: Implement per-node add_memorydebugfs interface

From: Shaohui Zheng
Date: Sun Dec 12 2010 - 22:33:57 EST


On Fri, Dec 10, 2010 at 03:30:38PM -0800, David Rientjes wrote:
> On Fri, 10 Dec 2010, Shaohui Zheng wrote:
>
> > > That doesn't address the question. My question is whether or not adding
> > > memory to a memoryless node in this way transitions its state to
> > > N_HIGH_MEMORY in the VM?
> > I guess that you are talking about memory hotplug on x86_32, memory hotplug is
> > NOT supported well for x86_32, and the function add_memory does not consider
> > this situlation.
> >
> > For 64bit, N_HIGH_MEMORY == N_NORMAL_MEMORY, so we need not to do the transition.
> >
>
> One more time :) Memoryless nodes do not have their bit set in
> N_HIGH_MEMORY. When memory is added to a memoryless node with this new
> interface, does the bit get set?

When we use debugfs add_node interface to add a fake node, the node was created,
and memory sections were created, but the state of the memory section is still
__offline__, so the new added node is still memoryless node. the result of debugfs
add_memory interface doing the similar thing with add_node, it just add memory
to an exists node.

For the state transition to N_HIGH_MEMORY, it does not happen on the above too
interfaces. It happens when the memory was onlined with sysfs /sys/device/system/memory/memoryXX/online
interface.

That is the code path:
store_mem_state
->memory_block_change_state
->memory_block_action
->online_pages

if (onlined_pages) {
kswapd_run(zone_to_nid(zone));
node_set_state(zone_to_nid(zone), N_HIGH_MEMORY);
}

does it address your question? thanks.

--
Thanks & Regards,
Shaohui

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/