On 06/08/2011 09:40 PM, Eric B Munson wrote: > On Wed, Jun 8, 2011 at 8:50 PM, David Gibson > <da...@gibson.dropbear.id.au> wrote: >> On Wed, Jun 08, 2011 at 11:16:42AM -0500, Andrew Hastings wrote: >>> On 06/07/11 11:08, Eric B Munson wrote: >>>> On Fri, 03 Jun 2011, Andrew Hastings wrote: >> [snip] >>>>> 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). >> >> And indeed, if you're doing thp without madvise, what is the hugetlbfs >> morecore actually doing that default morecore wouldn't. > > Forcing all calls to brk/mmap to be 2MB aligned.
In the interest of making the user interface slightly simpler, how about this: instead of a separate env. var. to enable the madvise, accept "HUGETLB_MORECORE=thp+" to enable 2MB alignment + the madvise. Actually, in thinking about this some more I wonder if the implementation ought to be using sbrk instead of mmap? This would allow the initial part of the heap (which begins in the data segment) to be mapped by transparent hugepages, and would avoid putting a "hole" in the virtual address space between the initial part of the heap and the hugepage-aligned part. -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