Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm: fix the TLB range flushed when __tlb_remove_page() runs out of slots

zap_pte_range loops from @addr to @end. In the middle, if it runs out of
batching slots, TLB entries needs to be flushed for @start to @interim,
NOT @interim to @end.

Since ARC port doesn't use page free batching I can't test it myself but
this seems like the right thing to do.

Observed this when working on a fix for the issue at thread:
http://www.spinics.net/lists/linux-arch/msg21736.html

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Vineet Gupta and committed by
Linus Torvalds
e6c495a9 f60e2a96

+6 -3
+6 -3
mm/memory.c
··· 1101 1101 spinlock_t *ptl; 1102 1102 pte_t *start_pte; 1103 1103 pte_t *pte; 1104 + unsigned long range_start = addr; 1104 1105 1105 1106 again: 1106 1107 init_rss_vec(rss); ··· 1207 1206 force_flush = 0; 1208 1207 1209 1208 #ifdef HAVE_GENERIC_MMU_GATHER 1210 - tlb->start = addr; 1211 - tlb->end = end; 1209 + tlb->start = range_start; 1210 + tlb->end = addr; 1212 1211 #endif 1213 1212 tlb_flush_mmu(tlb); 1214 - if (addr != end) 1213 + if (addr != end) { 1214 + range_start = addr; 1215 1215 goto again; 1216 + } 1216 1217 } 1217 1218 1218 1219 return addr;