aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hugetlb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r--include/linux/hugetlb.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 8c43cc469d78..b65166de1d9d 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -6,6 +6,8 @@
6#include <linux/fs.h> 6#include <linux/fs.h>
7#include <linux/hugetlb_inline.h> 7#include <linux/hugetlb_inline.h>
8#include <linux/cgroup.h> 8#include <linux/cgroup.h>
9#include <linux/list.h>
10#include <linux/kref.h>
9 11
10struct ctl_table; 12struct ctl_table;
11struct user_struct; 13struct user_struct;
@@ -23,6 +25,14 @@ struct hugepage_subpool {
23 long max_hpages, used_hpages; 25 long max_hpages, used_hpages;
24}; 26};
25 27
28struct resv_map {
29 struct kref refs;
30 spinlock_t lock;
31 struct list_head regions;
32};
33extern struct resv_map *resv_map_alloc(void);
34void resv_map_release(struct kref *ref);
35
26extern spinlock_t hugetlb_lock; 36extern spinlock_t hugetlb_lock;
27extern int hugetlb_max_hstate __read_mostly; 37extern int hugetlb_max_hstate __read_mostly;
28#define for_each_hstate(h) \ 38#define for_each_hstate(h) \
@@ -402,6 +412,16 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h,
402 return &mm->page_table_lock; 412 return &mm->page_table_lock;
403} 413}
404 414
415static inline bool hugepages_supported(void)
416{
417 /*
418 * Some platform decide whether they support huge pages at boot
419 * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when
420 * there is no such support
421 */
422 return HPAGE_SHIFT != 0;
423}
424
405#else /* CONFIG_HUGETLB_PAGE */ 425#else /* CONFIG_HUGETLB_PAGE */
406struct hstate {}; 426struct hstate {};
407#define alloc_huge_page_node(h, nid) NULL 427#define alloc_huge_page_node(h, nid) NULL