]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm: add new arch_make_huge_pte() method for tile support
authorChris Metcalf <cmetcalf@tilera.com>
Sun, 1 Apr 2012 18:01:34 +0000 (14:01 -0400)
committerChris Metcalf <cmetcalf@tilera.com>
Mon, 2 Apr 2012 19:37:10 +0000 (15:37 -0400)
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>
include/linux/hugetlb.h
mm/hugetlb.c

index 000837e126e64b3b0e64d67aff67a3c9626e4c5e..d5d6bbe2259e527b34d63abc4a93d64c469e8dd6 100644 (file)
@@ -284,6 +284,14 @@ static inline unsigned int blocks_per_huge_page(struct hstate *h)
 
 #include <asm/hugetlb.h>
 
+#ifndef arch_make_huge_pte
+static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
+                                      struct page *page, int writable)
+{
+       return entry;
+}
+#endif
+
 static inline struct hstate *page_hstate(struct page *page)
 {
        return size_to_hstate(PAGE_SIZE << compound_order(page));
index b8ce6f450956e6e3a9191cbf92afd1d490a32c9d..95d22f50d3bd81cf06bdc13c77606539b105a5ee 100644 (file)
@@ -2213,6 +2213,7 @@ static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page,
        }
        entry = pte_mkyoung(entry);
        entry = pte_mkhuge(entry);
+       entry = arch_make_huge_pte(entry, vma, page, writable);
 
        return entry;
 }