aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorAdam Litke <agl@us.ibm.com>2008-08-14 21:32:53 +0000
committerAdam Litke <agl@us.ibm.com>2008-08-14 21:32:53 +0000
commit9f8eb7881c78e73a62d62152a6b1106087cb6b5d (patch)
tree0be084868176275d47774b32804cbca2fe69b846 /init.c
parent9d204ef7366e2c84258f48588e725bf6855f5953 (diff)
downloadlibhugetlbfs-9f8eb7881c78e73a62d62152a6b1106087cb6b5d.tar.gz
Basic support for multiple hugetlbfs mount points
An upcoming release of the Linux kernel will support simultaneous use of multiple huge page sizes. Each size will be accessed through its own specially-mounted hugetlbfs filesystem. The first step in enabling libhugetlbfs to support multiple simultaneous page sizes is enabling the support of multiple simultaneous hugetlbfs mount points. This patch adds basic support for multiple mount points while preserving backwards-compatibility. Mount points can be added via the HUGETLB_PATH environment variable which has been extended in the normal way to allow multiple paths to be specified (using a colon separator). Mounts will also be discovered by reading /proc/mounts or /etc/mtab. Up to 10 mount points are allowed to co-exist but only one mount per page size is allowed. If HUGETLB_PATH is specified, only mount points listed in that variable will be added. Otherwise, paths in /proc/mounts or /etc/mtab will be added in order of appearance. The first mount point of a given size is used and subsequent mounts of that page size are skipped. For compatibility and ease of use, a default mount point is selected. When multiple mount points have been added, /proc/meminfo is read to determine the system's default huge page size and the mount point having that size is selected as the default. If a mount point for the default page size cannot be found, the first mount point found becomes the default. The gethugepagesize() call has been modified to return the default huge page size as determined the method just described. Signed-off-by: Adam Litke <agl@us.ibm.com>
Diffstat (limited to 'init.c')
-rw-r--r--init.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/init.c b/init.c
index e1415f5..94fc496 100644
--- a/init.c
+++ b/init.c
@@ -22,6 +22,7 @@
static void __attribute__ ((constructor)) setup_libhugetlbfs(void)
{
__hugetlbfs_setup_debug();
+ __lh_setup_mounts();
#ifndef NO_ELFLINK
__hugetlbfs_setup_elflink();
#endif