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

[PARISC] Always spinlock tlb flush operations to ensure preempt safety

Since taking a spinlock disables preempt, and we need to spinlock tlb flush
on SMP for N class, we might as well just spinlock on uniprocessor machines
too.

Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>

authored by

Matthew Wilcox and committed by
Kyle McMartin
29a622dd 9d7d5756

+4 -12
+4 -12
include/asm-parisc/tlbflush.h
··· 12 12 * N class systems, only one PxTLB inter processor broadcast can be 13 13 * active at any one time on the Merced bus. This tlb purge 14 14 * synchronisation is fairly lightweight and harmless so we activate 15 - * it on all SMP systems not just the N class. */ 16 - #ifdef CONFIG_SMP 15 + * it on all SMP systems not just the N class. We also need to have 16 + * preemption disabled on uniprocessor machines, and spin_lock does that 17 + * nicely. 18 + */ 17 19 extern spinlock_t pa_tlb_lock; 18 20 19 21 #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) 20 22 #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) 21 - 22 - #else 23 - 24 - #define purge_tlb_start(x) do { } while(0) 25 - #define purge_tlb_end(x) do { } while (0) 26 - 27 - #endif 28 - 29 23 30 24 extern void flush_tlb_all(void); 31 25 ··· 82 88 if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ 83 89 flush_tlb_all(); 84 90 else { 85 - preempt_disable(); 86 91 mtsp(vma->vm_mm->context,1); 87 92 purge_tlb_start(); 88 93 if (split_tlb) { ··· 95 102 pdtlb(start); 96 103 start += PAGE_SIZE; 97 104 } 98 - preempt_enable(); 99 105 } 100 106 purge_tlb_end(); 101 107 }