Re: about page migration on UMA

KAMEZAWA Hiroyuki
2007-11-12T00:50:00Z

On Fri, 09 Nov 2007 13:30:50 -0800
Dave Hansen <haveblue@us.ibm.com> wrote:

> On Fri, 2007-11-09 at 11:58 -0800, Christoph Lameter wrote:
> > Well one idea is to generate a sysfs file that can take a physical memory
> > range? echo the range to the sysfs file. The kernel can then try to
> > vacate the memory range.
>
> When memory hotplug is on, you should see memory broken up into
> "sections", and exported in sysfs today:
>
> /sys/devices/system/memory
>
> You can on/offline memory from there, and it should be pretty easy to
> figure out the physical addresses with the phys_index file.
>

yes.

Using current memory-hotplug interface is the easiest way.

What you have to do in your arch is...

1. support SPARSEMEM and define SECTION_SIZE to be suitable
2. add Memory Hotplug config. see mm/Kconfig
3. use ZONE_MOVABLE with boot option.
4. maybe you have to find that you have to define your own walk_memory_resource()
or not.

Maybe reading Badari's patches in these days for ppc64 support will help you.
Contiguous memory-size memory can be offlined.

One problem I don't understand is memory hotplug cannot be used if
CONFIG_HIBERNATION is on. If this is problem to you, you may need
some work.

Regards,
-Kame