diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 20 |
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 | ||
10 | struct ctl_table; | 12 | struct ctl_table; |
11 | struct user_struct; | 13 | struct 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 | ||
28 | struct resv_map { | ||
29 | struct kref refs; | ||
30 | spinlock_t lock; | ||
31 | struct list_head regions; | ||
32 | }; | ||
33 | extern struct resv_map *resv_map_alloc(void); | ||
34 | void resv_map_release(struct kref *ref); | ||
35 | |||
26 | extern spinlock_t hugetlb_lock; | 36 | extern spinlock_t hugetlb_lock; |
27 | extern int hugetlb_max_hstate __read_mostly; | 37 | extern 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 | ||
415 | static 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 */ |
406 | struct hstate {}; | 426 | struct hstate {}; |
407 | #define alloc_huge_page_node(h, nid) NULL | 427 | #define alloc_huge_page_node(h, nid) NULL |