.. | .. |
---|
7 | 7 | #include <linux/fs.h> |
---|
8 | 8 | #include <linux/hugetlb_inline.h> |
---|
9 | 9 | #include <linux/cgroup.h> |
---|
| 10 | +#include <linux/page_ref.h> |
---|
10 | 11 | #include <linux/list.h> |
---|
11 | 12 | #include <linux/kref.h> |
---|
12 | 13 | #include <linux/pgtable.h> |
---|
.. | .. |
---|
148 | 149 | vm_flags_t vm_flags); |
---|
149 | 150 | long hugetlb_unreserve_pages(struct inode *inode, long start, long end, |
---|
150 | 151 | long freed); |
---|
151 | | -bool isolate_huge_page(struct page *page, struct list_head *list); |
---|
| 152 | +int isolate_hugetlb(struct page *page, struct list_head *list); |
---|
152 | 153 | void putback_active_hugepage(struct page *page); |
---|
153 | 154 | void move_hugetlb_state(struct page *oldpage, struct page *newpage, int reason); |
---|
154 | 155 | void free_huge_page(struct page *page); |
---|
.. | .. |
---|
334 | 335 | return NULL; |
---|
335 | 336 | } |
---|
336 | 337 | |
---|
337 | | -static inline bool isolate_huge_page(struct page *page, struct list_head *list) |
---|
| 338 | +static inline int isolate_hugetlb(struct page *page, struct list_head *list) |
---|
338 | 339 | { |
---|
339 | | - return false; |
---|
| 340 | + return -EBUSY; |
---|
340 | 341 | } |
---|
341 | 342 | |
---|
342 | 343 | static inline void putback_active_hugepage(struct page *page) |
---|
.. | .. |
---|
552 | 553 | if (!page_size_log) |
---|
553 | 554 | return &default_hstate; |
---|
554 | 555 | |
---|
555 | | - return size_to_hstate(1UL << page_size_log); |
---|
| 556 | + if (page_size_log < BITS_PER_LONG) |
---|
| 557 | + return size_to_hstate(1UL << page_size_log); |
---|
| 558 | + |
---|
| 559 | + return NULL; |
---|
556 | 560 | } |
---|
557 | 561 | |
---|
558 | 562 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) |
---|
.. | .. |
---|
963 | 967 | #define flush_hugetlb_tlb_range(vma, addr, end) flush_tlb_range(vma, addr, end) |
---|
964 | 968 | #endif |
---|
965 | 969 | |
---|
| 970 | +#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE |
---|
| 971 | +static inline bool hugetlb_pmd_shared(pte_t *pte) |
---|
| 972 | +{ |
---|
| 973 | + return page_count(virt_to_page(pte)) > 1; |
---|
| 974 | +} |
---|
| 975 | +#else |
---|
| 976 | +static inline bool hugetlb_pmd_shared(pte_t *pte) |
---|
| 977 | +{ |
---|
| 978 | + return false; |
---|
| 979 | +} |
---|
| 980 | +#endif |
---|
| 981 | + |
---|
966 | 982 | #endif /* _LINUX_HUGETLB_H */ |
---|