Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: add new arch_make_huge_pte() method for tile support

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.

Reviewed-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

+9
+8
include/linux/hugetlb.h
··· 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));
+1
mm/hugetlb.c
··· 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 }