powerpc: Fix ppc32 mm_struct CPU tracking in SMP
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 27 Nov 2008 20:05:05 +0000 (20:05 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 3 Dec 2008 09:46:35 +0000 (20:46 +1100)
The 32-bit hash code didn't need it so far so we don't update
mm->cpu_vm_mask on context switch.  This however will break when we
merge the RCU based page table freeing patch and other upcoming 32-bit
embedded SMP work, so this adds the update.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/include/asm/mmu_context.h

index 6b993ef..b570209 100644 (file)
@@ -180,6 +180,9 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
 
        tsk->thread.pgdir = next->pgd;
 
+       if (!cpu_isset(smp_processor_id(), next->cpu_vm_mask))
+               cpu_set(smp_processor_id(), next->cpu_vm_mask);
+
        /* No need to flush userspace segments if the mm doesnt change */
        if (prev == next)
                return;