diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-10-29 21:16:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 00:40:42 -0400 |
commit | a7e4705b24e611574e5c23105005ffdff694fd58 (patch) | |
tree | 891228898aaa599e4f9f0f56e9f7cc6659b1cde7 | |
parent | 92dc6fcc845d99e87d8168e0786796525832d130 (diff) |
[PATCH] mm: cris v32 mmu_context_lock
The cris v32 switch_mm guards get_mmu_context with next->page_table_lock: good
it's not really SMP yet, since get_mmu_context messes with global variables
affecting other mms. Replace by global mmu_context_lock.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/cris/arch-v32/mm/tlb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/cris/arch-v32/mm/tlb.c b/arch/cris/arch-v32/mm/tlb.c index 8233406798d3..b08a28bb58ab 100644 --- a/arch/cris/arch-v32/mm/tlb.c +++ b/arch/cris/arch-v32/mm/tlb.c | |||
@@ -175,6 +175,8 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
175 | return 0; | 175 | return 0; |
176 | } | 176 | } |
177 | 177 | ||
178 | static DEFINE_SPINLOCK(mmu_context_lock); | ||
179 | |||
178 | /* Called in schedule() just before actually doing the switch_to. */ | 180 | /* Called in schedule() just before actually doing the switch_to. */ |
179 | void | 181 | void |
180 | switch_mm(struct mm_struct *prev, struct mm_struct *next, | 182 | switch_mm(struct mm_struct *prev, struct mm_struct *next, |
@@ -183,10 +185,10 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
183 | int cpu = smp_processor_id(); | 185 | int cpu = smp_processor_id(); |
184 | 186 | ||
185 | /* Make sure there is a MMU context. */ | 187 | /* Make sure there is a MMU context. */ |
186 | spin_lock(&next->page_table_lock); | 188 | spin_lock(&mmu_context_lock); |
187 | get_mmu_context(next); | 189 | get_mmu_context(next); |
188 | cpu_set(cpu, next->cpu_vm_mask); | 190 | cpu_set(cpu, next->cpu_vm_mask); |
189 | spin_unlock(&next->page_table_lock); | 191 | spin_unlock(&mmu_context_lock); |
190 | 192 | ||
191 | /* | 193 | /* |
192 | * Remember the pgd for the fault handlers. Keep a seperate copy of it | 194 | * Remember the pgd for the fault handlers. Keep a seperate copy of it |