Liangxu Linux
Apr 6, 2023 · Operations
How Linux Compacts Memory to Eliminate Fragmentation
This article explains the problem of memory fragmentation in Linux, describes the compaction algorithm that moves free pages together, and walks through the key kernel functions—alloc_pages_node, __alloc_pages_direct_compact, try_to_compact_pages, isolate_migratepages, migrate_pages, and unmap_and_move—detailing their roles in gathering movable pages and relocating them to create contiguous memory blocks.
KernelLinuxMemory Fragmentation
0 likes · 10 min read
