1GET_HUGE_PAGES(3)          Library Functions Manual          GET_HUGE_PAGES(3)
2
3
4

NAME

6       get_huge_pages, free_huge_pages - Allocate and free hugepages
7

SYNOPSIS

9       #include <hugetlbfs.h>
10
11       void *get_huge_pages(size_t len, ghp_t flags);
12       void free_huge_pages(void *ptr);
13

DESCRIPTION

15       get_huge_pages()  allocates a memory region len bytes in size backed by
16       hugepages. Hugepages may be of benefit to applications that  use  large
17       amounts  of  address  space  and suffer a  performance hit  due to  TLB
18       misses.  Wall-clock  time or oprofile can be used to determine if there
19       is a performance benefit from using hugepages or not.
20
21       The  len parameter must be hugepage-aligned. In the current implementa‐
22       tion, only the default hugepage size may be allocated  via  this  func‐
23       tion. Use gethugepagesize to discover what the alignment should be.
24
25       The  flags argument changes the behaviour of the function. Flags may be
26       or'd together.
27
28
29       GHP_DEFAULT
30
31              Allocate a region of memory of the requested  length  backed  by
32              hugepages  of  the  default hugepage size. Return NULL if suffi‐
33              cient pages are not available
34
35
36       free_huge_pages()   frees   a   region   of   memory    allocated    by
37       get_huge_pages().  The  behaviour of the function if another pointer is
38       used, valid or otherwise, is undefined.
39
40

RETURN VALUE

42       On success, a pointer is returned to the allocated  memory.  On  error,
43       NULL is returned. errno will be set based on what the failure of mmap()
44       was due to.
45
46

SEE ALSO

48       oprofile(1)  ,  gethugepagesize(3)  ,  get_hugepage_region(3)  ,   lib‐
49       hugetlbfs(7)
50

AUTHORS

52       libhugetlbfs  was  written  by various people on the libhugetlbfs-devel
53       mailing list.
54
55
56
57
58                                October 8, 2008              GET_HUGE_PAGES(3)
Impressum