aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2008-06-30 16:53:31 +0100
committerNishanth Aravamudan <nacc@us.ibm.com>2008-07-02 15:12:00 -0700
commit3630e5e8759cfee2a8f8f75879b1bac056003134 (patch)
tree0cad3572966182ff87cf8e58a2693fc2ea52af6d /Makefile
parentba1eb8be6f14f1d179bacb3e78cb2d811d4fa812 (diff)
downloadlibhugetlbfs-3630e5e8759cfee2a8f8f75879b1bac056003134.tar.gz
Provide a direct allocator API for huge pages
HUGETLB_MORECORE currently exists to allow glibc to back malloc() with large pages instead of small pages. However, not all applications use glibc malloc() nor is it always desirable to back malloc() with huge pages. There exists a requirement that a hugepage-aware application be able to allocate hugepages directly. Currently, each application is expected to discover the filesystem themselves, mmap() the file and other house-keeping tasks. libhugetlbfs already implements much of this complex logic internally. This patch exposes a simple API for the allocation and freeing of regions backed by hugepages. The implementation is a little over-simplistic but can be optimised later if and when applications perceive its performance to be a bottleneck. The API itself should not need to change as a multi-page aware API would be an additional rather than a replacement interface. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f09ce20..d69a365 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,11 @@
PREFIX = /usr/local
EXEDIR = /bin
-LIBOBJS = hugeutils.o version.o init.o morecore.o debug.o
+LIBOBJS = hugeutils.o version.o init.o morecore.o debug.o alloc.o
OBJS = hugectl.o
INSTALL_OBJ_LIBS = libhugetlbfs.so libhugetlbfs.a
INSTALL_OBJ = hugectl
+INSTALL_HEADERS = hugetlbfs.h
LDSCRIPT_TYPES = B BDT
LDSCRIPT_DIST_ELF = elf32ppclinux elf64ppc elf_i386 elf_x86_64
INSTALL_OBJSCRIPT = ld.hugetlbfs
@@ -92,6 +93,7 @@ endif
LIBOBJS32 += $(LIBOBJS:%=obj32/%)
LIBOBJS64 += $(LIBOBJS:%=obj64/%)
+HEADERDIR = $(PREFIX)/include
LIBDIR32 = $(PREFIX)/$(LIB32)
LIBDIR64 = $(PREFIX)/$(LIB64)
LDSCRIPTDIR = $(PREFIX)/share/libhugetlbfs/ldscripts
@@ -269,6 +271,7 @@ objscript.%: %
install: libs tools $(OBJDIRS:%=%/install) $(INSTALL_OBJSCRIPT:%=objscript.%)
@$(VECHO) INSTALL
$(INSTALL) -d $(DESTDIR)$(LDSCRIPTDIR)
+ $(INSTALL) -m 644 $(INSTALL_HEADERS) $(HEADERDIR)
$(INSTALL) -m 644 $(INSTALL_LDSCRIPTS:%=ldscripts/%) $(DESTDIR)$(LDSCRIPTDIR)
$(INSTALL) -d $(DESTDIR)$(BINDIR)
$(INSTALL) -d $(DESTDIR)$(EXEDIR)