Skip to contentSkip to conversation

mm/thp: Preserve pgprot across huge page split

tip:sched/numa tip-bot for Peter Zijlstra 1 participant 1 message Sep 27, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  93c9d633bd9e183f105bc59d798d61c216a514f0
Gitweb:     http://git.kernel.org/tip/93c9d633bd9e183f105bc59d798d61c216a514f0
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Tue, 17 Jul 2012 18:25:14 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 26 Sep 2012 11:48:31 +0200

mm/thp: Preserve pgprot across huge page split

If we marked a THP with our special PROT_NONE protections, ensure we don't loose them over a split.

Collapse seems to always allocate a new (huge) page which should already end up on the new target node so loosing protections there isn't a problem.

---
 arch/x86/include/asm/pgtable.h |    1 +
 mm/huge_memory.c               |  104 +++++++++++++++++++---------------------
 2 files changed, 50 insertions(+), 55 deletions(-)
arch/x86/include/asm/pgtable.h +1 -0
index 49afb3f..402704f 100644
@@ -350,6 +350,7 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
 }
 
 #define pte_pgprot(x) __pgprot(pte_flags(x) & PTE_FLAGS_MASK)
+#define pmd_pgprot(x) __pgprot(pmd_val(x) & ~_HPAGE_CHG_MASK)
 
 #define canon_pgprot(p) __pgprot(massage_pgprot(p))
 
mm/huge_memory.c +49 -55

122 lines not on this page · raw message