Hugetlb Page Migration
updated Apr 21 2005
Contents
Linux 2.6 has the feature which allows processes to use large pages,
which is often called hugetlb pages. This feature will be widely used
to gain good performance in high performance computing or others.
Hugetlb pages are not exceptions to be migrated in case of memory hot-removal.
Is it possible to migrate hugetlb pages like normal pages?
Yes, if some lacked functions are added.
Linux kernel 2.6 manages hugetlb pages very similar to that for normal pages.
The pages are placed in the page_tree of the corresponding inode in hugetlbfs
as if they're in the page-cache.
Linux VM doesn't support some functionality for hugetlb pages, which are
related to demand paging mechanism. This means that it can't handle the
page-fault nor it can't reclaim these pages, either.
It is strictly required to implement them, on which the memory migration
infrastructure depends. With these functions, hugetlb pages can be migrated
as normal pages can.
- Implement a pagefault handler for hugetlb pages.
- Make try_to_unmap() be able to unmap hugetlb pages from process
address spaces.
There is another difficulty that hugetlb pages can hardly be allocated
as a replacement on demand at this moment, though the memory migration
requires it. Physically contiguous memory allocation has been an issue
to be solved for a long time.
Fortunately, this will become possible with the other related works
in the new future, which are "Memory defragmentation" and
"Free area splitting within zones."
Memory defragmentation can make free contiguous memory regions,
sweeping out the normal pages in it. The memory migration mechanism
is used to sweep out them.
After all, hugetlb pages can be moved to another place with these
implementation.
The sample implementation
is down-loadable, which is against linux-2.6.10-rc2-mm4.
This patch set is supposed to be applied over
memory hotplug code,
which already includes the memory migration code for normal pages.
Hirokazu Takahashi (a.k.a. taka @ valinux japan)