diff options
Diffstat (limited to 'include/linux/hugetlb.h')
| -rw-r--r-- | include/linux/hugetlb.h | 34 | 
1 files changed, 24 insertions, 10 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 205026175c42..5e35379f58a5 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -35,6 +35,9 @@ struct resv_map {  	struct kref refs;  	spinlock_t lock;  	struct list_head regions; +	long adds_in_progress; +	struct list_head region_cache; +	long region_cache_count;  };  extern struct resv_map *resv_map_alloc(void);  void resv_map_release(struct kref *ref); @@ -80,11 +83,18 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,  int hugetlb_reserve_pages(struct inode *inode, long from, long to,  						struct vm_area_struct *vma,  						vm_flags_t vm_flags); -void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); +long hugetlb_unreserve_pages(struct inode *inode, long start, long end, +						long freed);  int dequeue_hwpoisoned_huge_page(struct page *page);  bool isolate_huge_page(struct page *page, struct list_head *list);  void putback_active_hugepage(struct page *page);  void free_huge_page(struct page *page); +void hugetlb_fix_reserve_counts(struct inode *inode, bool restore_reserve); +extern struct mutex *hugetlb_fault_mutex_table; +u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm, +				struct vm_area_struct *vma, +				struct address_space *mapping, +				pgoff_t idx, unsigned long address);  #ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE  pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); @@ -320,9 +330,13 @@ struct huge_bootmem_page {  #endif  }; +struct page *alloc_huge_page(struct vm_area_struct *vma, +				unsigned long addr, int avoid_reserve);  struct page *alloc_huge_page_node(struct hstate *h, int nid);  struct page *alloc_huge_page_noerr(struct vm_area_struct *vma,  				unsigned long addr, int avoid_reserve); +int huge_add_to_page_cache(struct page *page, struct address_space *mapping, +			pgoff_t idx);  /* arch callback */  int __init alloc_bootmem_huge_page(struct hstate *h); @@ -460,18 +474,18 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h,  	return &mm->page_table_lock;  } -static inline bool hugepages_supported(void) -{ -	/* -	 * Some platform decide whether they support huge pages at boot -	 * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when -	 * there is no such support -	 */ -	return HPAGE_SHIFT != 0; -} +#ifndef hugepages_supported +/* + * Some platform decide whether they support huge pages at boot + * time. Some of them, such as powerpc, set HPAGE_SHIFT to 0 + * when there is no such support + */ +#define hugepages_supported() (HPAGE_SHIFT != 0) +#endif  #else	/* CONFIG_HUGETLB_PAGE */  struct hstate {}; +#define alloc_huge_page(v, a, r) NULL  #define alloc_huge_page_node(h, nid) NULL  #define alloc_huge_page_noerr(v, a, r) NULL  #define alloc_bootmem_huge_page(h) NULL  |