Skip to contentSkip to conversation

x86: Allow 1GB pages to be SPECIAL similar to 2MB

PATCH In review James Custer 3 participants 3 messages Sep 24, 2014 – Sep 25, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Allow 1GB pages to be SPECIAL similar to 2MB

---
 arch/x86/mm/gup.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/mm/gup.c +1 -3
index dd74e46..12ca9cf 100644
@@ -121,7 +121,6 @@ static noinline int gup_huge_pmd(pmd_t pmd, unsigned long addr,
 		mask |= _PAGE_RW;
 	if ((pte_flags(pte) & mask) != mask)
 		return 0;
-	/* hugepages are never "special" */
 	VM_BUG_ON(pte_flags(pte) & _PAGE_SPECIAL);
 	VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
 
@@ -191,7 +190,6 @@ static noinline int gup_huge_pud(pud_t pud, unsigned long addr,
 		mask |= _PAGE_RW;
 	if ((pte_flags(pte) & mask) != mask)
 		return 0;
-	/* hugepages are never "special" */
 	VM_BUG_ON(pte_flags(pte) & _PAGE_SPECIAL);
 	VM_BUG_ON(!pfn_valid(pte_pfn(pte)));
 
@@ -223,7 +221,7 @@ static int gup_pud_range(pgd_t pgd, unsigned long addr, unsigned long end,
 		pud_t pud = *pudp;
 
 		next = pud_addr_end(addr, end);
-		if (pud_none(pud))
+		if (pud_none(pud) || (pud_val(pud) & _PAGE_SPECIAL))
 			return 0;
 		if (unlikely(pud_large(pud))) {
 			if (!gup_huge_pud(pud, addr, next, write, pages, nr))
Signature · 1 line
1.8.2.1
#1 lore raw
Quoted 2 lines · James Custer

With no changelog to describe the motivation for this change or to specify why it's required, I doubt you're going to get your patches merged by the x86 maintainers.

#2 lore raw
Quoted 8 lines · David Rientjes
Quoted 2 lines · James Custer

With no changelog to describe the motivation for this change or to specify why it's required, I doubt you're going to get your patches merged by the x86 maintainers.

Indeed. Was about to rant about this ...

tglx