Hello, Eric!

On 05/26/2011 12:13 PM, Eric B Munson wrote:
> diff --git a/HOWTO b/HOWTO
> index 3c1f124..b018543 100644
> --- a/HOWTO
> +++ b/HOWTO
> @@ -2,7 +2,7 @@ libhugetlbfs HOWTO
>   ==================
>
>   Author: David Gibson<d...@au1.ibm.com>, Adam Litke<a...@us.ibm.com>, and 
> others
> -Last updated: February 1st, 2011
> +Last updated: May 25th, 2011
>
>   Introduction
>   ============
> @@ -264,6 +264,11 @@ environment variables:
>     To use a specific huge page size:
>          HUGETLB_MORECORE=<pagesize>
>
> +  To use Transparent Huge Pages (THP):
> +       HUGETLB_MORECORE=thp
> +
> +Note: This option requires a kernel that supports Transparent Huge Pages
> +
>   Usually it's preferable to set these environment variables on the
>   command line of the program you wish to run, rather than using
>   "export", because you'll only want to enable the hugepage malloc() for
> @@ -599,6 +604,10 @@ libhugetlbfs:
>       HUGETLB_NO_PREFAULT
>               Explained in "Using hugepages for malloc()
>               (morecore)"
> +     HUGETLB_THP_MADVISE
> +             When using thp for HUGETLB_MORECORE, this signals that
> +             allocations for the heap should use madvise(MADV_HUGEPAGE) to
> +             mark them as appropriate for collapsing by khugepaged

Probably just idle curiosity, but why would someone want to set 
HUGETLB_MORECORE=thp and not set HUGETLB_THP_MADVISE at the same time?

Might it make sense for HUGETLB_MORECORE=thp to automatically turn on 
the madvise(MADV_HUGEPAGE)?  If necessary, a separate env. var. could 
disable the automatic madvise.


> @@ -220,7 +229,8 @@ void hugetlbfs_setup_morecore(void)
>        * This can be set explicitly by setting HUGETLB_MORECORE to a valid
>        * page size string or by setting HUGETLB_DEFAULT_PAGE_SIZE.
>        */
> -     if (strncasecmp(__hugetlb_opts.morecore, "y", 1) == 0)
> +     if ((strncasecmp(__hugetlb_opts.morecore, "y", 1) == 0) ||
> +                     __hugetlb_opts.thp_morecore)
>               hpage_size = gethugepagesize();
>       else
>               hpage_size = parse_page_size(__hugetlb_opts.morecore);

thp_morecore should probably use kernel_default_hugepage_size() instead 
of gethugepagesize().  gethugepagesize() will use 
HUGETLB_DEFAULT_PAGE_SIZE if set.

-Andrew Hastings
  Cray Inc.

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to