HugePage by default

Xin Tong trent.tong at gmail.com
Wed Jul 30 16:06:39 EDT 2014


I see 2 ways to do this.

1. allocate 512 4KB contiguous pages everytime a handle_mm_fault is called
and have the THP kernel thread to coalesce it to a huge page.
2. modify the kernel (maybe extensively) to allocate 2MB page by default.

I like 1. better because it requires less modifications. but it is not as
reliable. any suggestions

Xin



On Wed, Jul 30, 2014 at 2:57 PM, <Valdis.Kletnieks at vt.edu> wrote:

> On Wed, 30 Jul 2014 14:41:26 -0500, Xin Tong said:
>
> > Is there anyway for me to turn on HugePage by default in the Linux X86
> > kernel, i.e. allocate a 2MB page by default in place of 4KB now ?
>
> Possibly related config entries to research:
>
> CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
> CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y
> CONFIG_TRANSPARENT_HUGEPAGE=y
> CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
> # CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
>
> However, if you allocate a single 4K page, that *won't* automatically
> promote it to a hugepage - you need to allocate 2M of contiguous virtual
> address space with the same access flags for it to coalesce into a
> hugepage.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140730/40e1cfd2/attachment.html 


More information about the Kernelnewbies mailing list