As of 2.6.32 mmap supports the MAP_HUGETLB flag that will, when there are available huge pages, return an anonymous region backed by huge pages. This allows us to use default sized huge pages for morecore and get_huge_pages without forcing the admin to mount hugetlbfs.
Changes from V4: Stop probing for all page sizes without mounts, we only care about the kernel default (that is what MAP_HUGETLB uses). All other page sizes will be picked up by mount scanning. Changes from V3: Tests that might use MAP_HUGETLB now lookup mapping page sizes in /proc/self/smaps instead of looking at the file backing. Protect areas that use MAP_HUGETLB with #ifdefs until the flag is added to glibc Changes from V2: use kernel_default_hugepage_size() instead of gethugepageize() to ensure that we are using kernel default huge page size before using MAP_HUGETLB rework fd accounting in hugetlb_prefault() Changes from V1: hugetlbfs_prefault now opens /dev/zero for reading in readv calls if MAP_HUGETLB was used for the mapping MAP_HUGETLB is only used for the process heap if the default huge page size is requested for MORECORE Eric B Munson (9): Add kernel feature check for MAP_HUGETLB Add check for MAP_HUGETLB support Separate finding page sizes from mount points Transition hugetlbfs_prefault to handle MAP_HUGETLB Read /proc/self/smaps to test page size of mapping Use MAP_HUGETLB in get_huge_pages Convert the get_huge_pages tests to use new smaps test Use MAP_HUGETLB for heap mappings Convert heap tests to use get_mapping_page_size alloc.c | 41 +++++++++++++++--- hugeutils.c | 103 +++++++++++++++++++++++++++++++----------- init.c | 5 ++ kernel-features.c | 4 ++ libhugetlbfs_internal.h | 9 ++++ libhugetlbfs_privutils.h | 3 + morecore.c | 35 +++++++++++--- tests/get_huge_pages.c | 12 +++-- tests/get_hugepage_region.c | 4 +- tests/heap-overflow.c | 7 ++- tests/heapshrink.c | 15 +++++- tests/hugetests.h | 1 + tests/malloc.c | 15 +++++- tests/malloc_manysmall.c | 14 +++++- tests/testutils.c | 53 ++++++++++++++++++++++ 15 files changed, 266 insertions(+), 55 deletions(-) ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today http://p.sf.net/sfu/msIE9-sfdev2dev _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel