]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - mm/mprotect.c
thp: mprotect: transparent huge page support
[mv-sheeva.git] / mm / mprotect.c
index 9402080d0d4a88a622598b6dcfacb85f264204a8..5a688a2756bec54435adbd5f3c13a33fbdd2c11e 100644 (file)
@@ -88,7 +88,13 @@ static inline void change_pmd_range(struct vm_area_struct *vma, pud_t *pud,
        pmd = pmd_offset(pud, addr);
        do {
                next = pmd_addr_end(addr, end);
-               split_huge_page_pmd(vma->vm_mm, pmd);
+               if (pmd_trans_huge(*pmd)) {
+                       if (next - addr != HPAGE_PMD_SIZE)
+                               split_huge_page_pmd(vma->vm_mm, pmd);
+                       else if (change_huge_pmd(vma, pmd, addr, newprot))
+                               continue;
+                       /* fall through */
+               }
                if (pmd_none_or_clear_bad(pmd))
                        continue;
                change_pte_range(vma->vm_mm, pmd, addr, next, newprot,