Skip to contentSkip to conversation

mm/x86: Flush lazy MMU when DEBUG_PAGEALLOC is set

PATCH RESEND New Boris Ostrovsky 2 participants 2 messages Apr 11, 2013 – Apr 14, 2013

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

PATCH RESEND 1/1 mm/x86: Flush lazy MMU when DEBUG_PAGEALLOC is set

When CONFIG_DEBUG_PAGEALLOC is set page table updates made by kernel_map_pages() are not made visible (via TLB flush) immediately if lazy MMU is on. In environments that support lazy MMU (e.g. Xen) this may lead to fatal page faults, for example, when zap_pte_range() needs to allocate pages in __tlb_remove_page() -> tlb_next_batch().

---
 arch/x86/mm/pageattr.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/mm/pageattr.c +2 -0
index 091934e..2ccbe0b 100644
@@ -1413,6 +1413,8 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
 	 * but that can deadlock->flush only current cpu:
 	 */
 	__flush_tlb_all();
+
+	arch_flush_lazy_mmu_mode();
 }
 
 #ifdef CONFIG_HIBERNATION
Signature · 1 line
1.8.1.4
#1 lore raw

[tip:x86/urgent] x86/mm: Flush lazy MMU when DEBUG_PAGEALLOC is set

x86/mm: Flush lazy MMU when DEBUG_PAGEALLOC is set
Commit-ID:  26564600c9e88c6572a5e6ef5ae9121907edfb7f
Gitweb:     http://git.kernel.org/tip/26564600c9e88c6572a5e6ef5ae9121907edfb7f
Author:     Boris Ostrovsky <[email protected]>
AuthorDate: Thu, 11 Apr 2013 13:59:52 -0400
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 12 Apr 2013 07:19:19 +0200

x86/mm: Flush lazy MMU when DEBUG_PAGEALLOC is set

When CONFIG_DEBUG_PAGEALLOC is set page table updates made by kernel_map_pages() are not made visible (via TLB flush) immediately if lazy MMU is on. In environments that support lazy MMU (e.g. Xen) this may lead to fatal page faults, for example, when zap_pte_range() needs to allocate pages in __tlb_remove_page() -> tlb_next_batch().

---
 arch/x86/mm/pageattr.c | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/mm/pageattr.c +2 -0
index 7896f71..fb4e73e 100644
@@ -1413,6 +1413,8 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
 	 * but that can deadlock->flush only current cpu:
 	 */
 	__flush_tlb_all();
+
+	arch_flush_lazy_mmu_mode();
 }
 
 #ifdef CONFIG_HIBERNATION