thp: do not mark zero-page pmd write-protected explicitly
authorKirill A. Shutemov <kirill@shutemov.name>
Wed, 10 Dec 2014 23:44:22 +0000 (15:44 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:08 +0000 (17:41 -0800)
Zero pages can be used only in anonymous mappings, which never have
writable vma->vm_page_prot: see protection_map in mm/mmap.c and __PX1X
definitions.

Let's drop redundant pmd_wrprotect() in set_huge_zero_page().

Signed-off-by: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/huge_memory.c

index de984159cf0b8a0be6a73b9f421e9a0b4f75c599..5b2c6875fc38daae41b1361bfc4041f91e6473a7 100644 (file)
@@ -784,7 +784,6 @@ static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm,
        if (!pmd_none(*pmd))
                return false;
        entry = mk_pmd(zero_page, vma->vm_page_prot);
-       entry = pmd_wrprotect(entry);
        entry = pmd_mkhuge(entry);
        pgtable_trans_huge_deposit(mm, pmd, pgtable);
        set_pmd_at(mm, haddr, pmd, entry);