]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] mm: cris v32 mmu_context_lock
authorHugh Dickins <hugh@veritas.com>
Sun, 30 Oct 2005 01:16:37 +0000 (18:16 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 30 Oct 2005 04:40:42 +0000 (21:40 -0700)
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>
arch/cris/arch-v32/mm/tlb.c

index 8233406798d3d99a87e741a0889b269ccda8f7cd..b08a28bb58abab021e9dcd263067b6a5abd55a5b 100644 (file)
@@ -175,6 +175,8 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
        return 0;
 }
 
+static DEFINE_SPINLOCK(mmu_context_lock);
+
 /* Called in schedule() just before actually doing the switch_to. */
 void
 switch_mm(struct mm_struct *prev, struct mm_struct *next,
@@ -183,10 +185,10 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next,
        int cpu = smp_processor_id();
 
        /* Make sure there is a MMU context. */
-       spin_lock(&next->page_table_lock);
+       spin_lock(&mmu_context_lock);
        get_mmu_context(next);
        cpu_set(cpu, next->cpu_vm_mask);
-       spin_unlock(&next->page_table_lock);
+       spin_unlock(&mmu_context_lock);
 
        /*
         * Remember the pgd for the fault handlers. Keep a seperate copy of it