Skip to contentSkip to conversation

powerpc/mm/tlbflush: update the mmu_gather page size while iterating address range

PATCH Applied Aneesh Kumar K.V 4 participants 4 messages Aug 9, 2018 – Aug 13, 2018

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

PATCH 1/1 powerpc/mm/tlbflush: update the mmu_gather page size while iterating address range

This patch makes sure we update the mmu_gather page size even if we are requesting for a fullmm flush. This avoids triggering VM_WARN_ON in code paths like __tlb_remove_page_size that explicitly check for removing range page size to be same as mmu gather page size.

---
 arch/powerpc/include/asm/tlb.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/tlb.h +2 -4
index 97ecef697e1b..f0e571b2dc7c 100644
@@ -49,13 +49,11 @@ static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
 static inline void tlb_remove_check_page_size_change(struct mmu_gather *tlb,
 						     unsigned int page_size)
 {
-	if (tlb->fullmm)
-		return;
-
 	if (!tlb->page_size)
 		tlb->page_size = page_size;
 	else if (tlb->page_size != page_size) {
-		tlb_flush_mmu(tlb);
+		if (!tlb->fullmm)
+			tlb_flush_mmu(tlb);
 		/*
 		 * update the page size after flush for the new
 		 * mmu_gather.
Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Thu, 9 Aug 2018 19:06:59 +0530 "Aneesh Kumar K.V"…

This patch makes sure we update the mmu_gather page size even if we are requesting for a fullmm flush. This avoids triggering VM_WARN_ON in code paths like __tlb_remove_page_size that explicitly check for removing range page size to be same as mmu gather page size.

Thanks, sorry bout that.

Quoted 24 lines
---
 arch/powerpc/include/asm/tlb.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/tlb.h +2 -4
index 97ecef697e1b..f0e571b2dc7c 100644
@@ -49,13 +49,11 @@ static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
 static inline void tlb_remove_check_page_size_change(struct mmu_gather *tlb,
 						     unsigned int page_size)
 {
-	if (tlb->fullmm)
-		return;
-
 	if (!tlb->page_size)
 		tlb->page_size = page_size;
 	else if (tlb->page_size != page_size) {
-		tlb_flush_mmu(tlb);
+		if (!tlb->fullmm)
+			tlb_flush_mmu(tlb);
 		/*
 		 * update the page size after flush for the new
 		 * mmu_gather.
#2 lore raw
In reply to Aneesh Kumar K.V
Quoted 4 lines · Aneesh Kumar K.V

This patch makes sure we update the mmu_gather page size even if we are requesting for a fullmm flush. This avoids triggering VM_WARN_ON in code paths like __tlb_remove_page_size that explicitly check for removing range page size to be same as mmu gather page size.

I take it this is a fix for 5a6099346c41 ("powerpc/64s/radix: tlb do not flush on page size when fullmm") ?

cheers

Quoted 22 lines
arch/powerpc/include/asm/tlb.h +2 -4
index 97ecef697e1b..f0e571b2dc7c 100644
@@ -49,13 +49,11 @@ static inline void __tlb_remove_tlb_entry(struct mmu_gather *tlb, pte_t *ptep,
 static inline void tlb_remove_check_page_size_change(struct mmu_gather *tlb,
 						     unsigned int page_size)
 {
-	if (tlb->fullmm)
-		return;
-
 	if (!tlb->page_size)
 		tlb->page_size = page_size;
 	else if (tlb->page_size != page_size) {
-		tlb_flush_mmu(tlb);
+		if (!tlb->fullmm)
+			tlb_flush_mmu(tlb);
 		/*
 		 * update the page size after flush for the new
 		 * mmu_gather.
Signature · 1 line
2.17.1
#3 lore raw
In reply to Aneesh Kumar K.V
Quoted 7 lines · Aneesh Kumar K.V

This patch makes sure we update the mmu_gather page size even if we are requesting for a fullmm flush. This avoids triggering VM_WARN_ON in code paths like __tlb_remove_page_size that explicitly check for removing range page size to be same as mmu gather page size.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/0b6aa1a20add96437c46db77c9bae2

cheers