]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/thp: use the correct function when updating access flags
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 19 Jun 2013 00:05:56 +0000 (10:05 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Jun 2013 07:12:58 +0000 (17:12 +1000)
We should use pmdp_set_access_flags to update access flags.  Archs like
powerpc use extra checks(_PAGE_BUSY) when updating a hugepage PTE.  A
set_pmd_at doesn't do those checks.  We should use set_pmd_at only when
updating a none hugepage PTE.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>a
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c

index d8b3b850150cbac9c78fa8b55a6961a8da85c77c..4347eb3a00ff525525fec166abf758443704c669 100644 (file)
@@ -1265,7 +1265,9 @@ struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
                 * young bit, instead of the current set_pmd_at.
                 */
                _pmd = pmd_mkyoung(pmd_mkdirty(*pmd));
-               set_pmd_at(mm, addr & HPAGE_PMD_MASK, pmd, _pmd);
+               if (pmdp_set_access_flags(vma, addr & HPAGE_PMD_MASK,
+                                         pmd, _pmd,  1))
+                       update_mmu_cache_pmd(vma, addr, pmd);
        }
        if ((flags & FOLL_MLOCK) && (vma->vm_flags & VM_LOCKED)) {
                if (page->mapping && trylock_page(page)) {