aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric B Munson <emunson@mgebm.net>2010-11-23 08:52:09 -0700
committerEric B Munson <emunson@mgebm.net>2010-11-29 13:40:21 -0700
commitcca95fbca95828a2d75128ae5bb47c85ff2c03e3 (patch)
tree1421e103fea7273cbf0c0ae505d3781440e0f801
parent3e15b85caca5d11cb2102ab9ea16a37a4af8034b (diff)
downloadlibhugetlbfs-cca95fbca95828a2d75128ae5bb47c85ff2c03e3.tar.gz
Add kernel feature check for MAP_HUGETLB
Since 2.6.32 the kernel has supported pseudo-anonymous mmaps for huge pages without having hugetlbfs mounted. This patch adds a check for that kernel feature. Signed-off-by: Eric B Munson <emunson@mgebm.net> Acked-by: Mel Gorman <mel@csn.ul.ie>
-rw-r--r--kernel-features.c4
-rw-r--r--libhugetlbfs_privutils.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/kernel-features.c b/kernel-features.c
index 09d0486..b8cdec9 100644
--- a/kernel-features.c
+++ b/kernel-features.c
@@ -44,6 +44,10 @@ static struct feature kernel_features[] = {
[HUGETLB_FEATURE_SAFE_NORESERVE] = {
.name = "noreserve_safe",
.required_version = "2.6.34",
+ },
+ [HUGETLB_FEATURE_MAP_HUGETLB] = {
+ .name = "map_hugetlb",
+ .required_version = "2.6.32",
}
};
diff --git a/libhugetlbfs_privutils.h b/libhugetlbfs_privutils.h
index aaa638f..149e42f 100644
--- a/libhugetlbfs_privutils.h
+++ b/libhugetlbfs_privutils.h
@@ -80,6 +80,9 @@ enum {
/* Whether use of MAP_NORESERVE is safe or can result in OOM */
HUGETLB_FEATURE_SAFE_NORESERVE,
+ /* If the kernel has the ability to mmap(MAP_HUGETLB)*/
+ HUGETLB_FEATURE_MAP_HUGETLB,
+
HUGETLB_FEATURE_NR,
};
#define hugetlbfs_test_feature __pu_hugetlbfs_test_feature