Commit 29a622dd2b577d98731d325954f328b810826cfa
Committed by
Kyle McMartin
1 parent
9d7d57567c
Exists in
master
and in
7 other branches
[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>
Showing 1 changed file with 4 additions and 12 deletions Side-by-side Diff
include/asm-parisc/tlbflush.h
... | ... | @@ -12,21 +12,15 @@ |
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 | 23 | |
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 | - | |
30 | 24 | extern void flush_tlb_all(void); |
31 | 25 | |
32 | 26 | /* |
... | ... | @@ -88,7 +82,6 @@ |
88 | 82 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ |
89 | 83 | flush_tlb_all(); |
90 | 84 | else { |
91 | - preempt_disable(); | |
92 | 85 | mtsp(vma->vm_mm->context,1); |
93 | 86 | purge_tlb_start(); |
94 | 87 | if (split_tlb) { |
... | ... | @@ -102,7 +95,6 @@ |
102 | 95 | pdtlb(start); |
103 | 96 | start += PAGE_SIZE; |
104 | 97 | } |
105 | - preempt_enable(); | |
106 | 98 | } |
107 | 99 | purge_tlb_end(); |
108 | 100 | } |