In 2.6.20-rc6, the patch submitted by Mel Gorman introduces zone_movable to prevent zone memory fragmentation.
Zone_movable indicates that this zone can only be allocated and used with the _ gfp_highmem and _ gfp_movable labels. This limits all non-movable pages to a single memory area, while the allocation of movable is met by other memory areas. This patch can be used with the linked list-based anti-fragment patch.
The size of the movable zone is specified by the Kernel Parameter "kernelcore =. This parameter specifies how much memory is allocated to zone_movalbe. All pages in zone_movable zone can be migrated or recycled.
When we select a zone page for zone_movable, we need to consider two points:
First, only the memory in the highest memory zone can be used for zone_movable. For the x86 ARM platform, zone_highmem is used, zone_dma is used for ppc64, and zone_dma32 is used for x86_64.
Secondly, the memory used by the kernel may be evenly distributed across multiple NUMA nodes. If the size of these nodes is different, the number of memory used by the kernel on different nodes is different.
By default, this zone is not used as a huge pages allocation, because the huge pages allocation is fixed and non-migratable. A sysctl hugepages_treat_as_movable is provided to allow huge pages allocation on zone_movable. This means that after the system executes this system call, the size of the huge page pool contains the size of zone_movable.
Except Hugh pages, which can be non-ovable, the author does not introduce other fragments that may cause zone_movable distribution.