On Fri, 03 Jun 2011, Andrew Hastings wrote:

> 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.

It is possible to use THP without being madvise'd, infact if I read the
transhuge documentation correctly, the madvise is only useful when system-wide
transparent huge pages are not enabled (the sysctl is set to 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.

Thanks, I will make this change for the next revision.

> 
> -Andrew Hastings
>  Cray Inc.
> 

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to