On 06/07/11 11:08, Eric B Munson wrote: > 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).
Sure, but if the user has gone to all the bother of setting HUGETLB_MORECORE=thp, the principal of least surprise suggests that that setting should work even if the sysctl is set to madvise. It doesn't hurt to do the madvise if the sysctl has a different setting, does it? But if the current semantics are preferred, the documentation should at least provide a explanation of why HUGETLB_MORECORE=thp alone might not work as expected (i.e., the sysctl is set to madvise). -Andrew Hastings Cray Inc. ------------------------------------------------------------------------------ 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