On Wed, 25 Aug 2010 15:58:14 -0700
Andrew Morton <akpm@linux-foundation.org> wrote:
Hmm, you may not like this..but how about following kind of interface ?
Now, memoyr hotplug supports following operation to free and _isolate_
memory region.
# echo offline > /sys/devices/system/memory/memoryX/state
Then, a region of memory will be isolated. (This succeeds if there are free
memory.)
Add a new interface.
% echo offline > /sys/devices/system/memory/memoryX/state
# extract memory from System RAM and make them invisible from buddy allocator.
% echo cma > /sys/devices/system/memory/memoryX/state
# move invisible memory to cma.
Then, a chunk of memory will be moved into contiguous-memory-allocator.
To move "cma" region as usual region,
# echo offline > /sys/devices/system/memory/memoryX/state
# echo online > /sys/devices/system/memory/memoryX/state
Maybe "used-for-cma" memory are can be populated via /proc/iomem
As,
100000000-63fffffff : System RAM
640000000-800000000 : Contiguous RAM (Used for drivers)
(And you have to skip small memory holes by seeing this file)
Of course, cma guys can keep continue to use their own boot option.
With memory hotplug, kernelcore=xxxM interface can be used for creating
ZONE_MOVABLE. Some complicated work may be needed as
# echo movable > /sys/devices/system/memory/memoryX/state
(online pages and move them into ZONE_MOVABLE)
If anyone interested in, I may be able to offer some help.
Thanks,
-Kame
--