In ZGC, small pages are allocated from the beginning of the address space (low addresses), while medium and large pages are allocated from the end of the address space (high addresses). However, small pages can sometimes end up on a high address if a medium or a large page was split into small pages. Over time this can cause the address space to become fragmented, with the risk of eventually running out of address space for new large allocations.
To mitigate this, we can defragment the address space by letting small pages at high addresses be remapped to lower addresses.
To mitigate this, we can defragment the address space by letting small pages at high addresses be remapped to lower addresses.