diff options
author | Matthew Wilcox <willy@parisc-linux.org> | 2005-11-17 16:44:14 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@parisc-linux.org> | 2005-11-17 16:44:14 -0500 |
commit | 29a622dd2b577d98731d325954f328b810826cfa (patch) | |
tree | d74d5041d1292950dd50d96436f2448b5e6e21bc | |
parent | 9d7d57567c026a06f0cb2edabe75250d8f61d44a (diff) |
[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>
-rw-r--r-- | include/asm-parisc/tlbflush.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index e97aa8d1eff5..c9ec39c6fc6c 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h | |||
@@ -12,21 +12,15 @@ | |||
12 | * N class systems, only one PxTLB inter processor broadcast can be | 12 | * N class systems, only one PxTLB inter processor broadcast can be |
13 | * active at any one time on the Merced bus. This tlb purge | 13 | * active at any one time on the Merced bus. This tlb purge |
14 | * synchronisation is fairly lightweight and harmless so we activate | 14 | * synchronisation is fairly lightweight and harmless so we activate |
15 | * it on all SMP systems not just the N class. */ | 15 | * it on all SMP systems not just the N class. We also need to have |
16 | #ifdef CONFIG_SMP | 16 | * preemption disabled on uniprocessor machines, and spin_lock does that |
17 | * nicely. | ||
18 | */ | ||
17 | extern spinlock_t pa_tlb_lock; | 19 | extern spinlock_t pa_tlb_lock; |
18 | 20 | ||
19 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) | 21 | #define purge_tlb_start(x) spin_lock(&pa_tlb_lock) |
20 | #define purge_tlb_end(x) spin_unlock(&pa_tlb_lock) | 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 | extern void flush_tlb_all(void); | 24 | extern void flush_tlb_all(void); |
31 | 25 | ||
32 | /* | 26 | /* |
@@ -88,7 +82,6 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, | |||
88 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ | 82 | if (npages >= 512) /* 2MB of space: arbitrary, should be tuned */ |
89 | flush_tlb_all(); | 83 | flush_tlb_all(); |
90 | else { | 84 | else { |
91 | preempt_disable(); | ||
92 | mtsp(vma->vm_mm->context,1); | 85 | mtsp(vma->vm_mm->context,1); |
93 | purge_tlb_start(); | 86 | purge_tlb_start(); |
94 | if (split_tlb) { | 87 | if (split_tlb) { |
@@ -102,7 +95,6 @@ static inline void flush_tlb_range(struct vm_area_struct *vma, | |||
102 | pdtlb(start); | 95 | pdtlb(start); |
103 | start += PAGE_SIZE; | 96 | start += PAGE_SIZE; |
104 | } | 97 | } |
105 | preempt_enable(); | ||
106 | } | 98 | } |
107 | purge_tlb_end(); | 99 | purge_tlb_end(); |
108 | } | 100 | } |