The tile support for multiple-size huge pages requires tagging the hugetlb PTE with a "super" bit for PTEs that are multiples of the basic size of a pagetable span. To set that bit properly we need to tweak the PTe in make_huge_pte() based on the vma. This change provides the API for a subsequent tile-specific change to use.
Unified · Split
| @@ -284,6 +284,14 @@ static inline unsigned int blocks_per_huge_page(struct hstate *h) · 283 unmodified lines | ||
| 284 | 284 | |
| 285 | 285 | #include <asm/hugetlb.h> |
| 286 | 286 | |
| 287 | +#ifndef arch_make_huge_pte | |
| 288 | +static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, | |
| 289 | + struct page *page, int writable) | |
| 290 | +{ | |
| 291 | + return entry; | |
| 292 | +} | |
| 293 | +#endif | |
| 294 | + | |
| 287 | 295 | static inline struct hstate *page_hstate(struct page *page) |
| 288 | 296 | { |
| 289 | 297 | return size_to_hstate(PAGE_SIZE << compound_order(page)); |
| @@ -2213,6 +2213,7 @@ static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page, · 2212 unmodified lines | ||
| 2213 | 2213 | } |
| 2214 | 2214 | entry = pte_mkyoung(entry); |
| 2215 | 2215 | entry = pte_mkhuge(entry); |
| 2216 | + entry = arch_make_huge_pte(entry, vma, page, writable); | |
| 2216 | 2217 | |
| 2217 | 2218 | return entry; |
| 2218 | 2219 | } |