Skip to contentSkip to conversation

powerpc: Fix ppc32 mm_struct CPU tracking in SMP

PATCH New Benjamin Herrenschmidt 1 participant 1 message Nov 28, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix ppc32 mm_struct CPU tracking in SMP

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 breaks the merge of the RCU based page table freeing and other upcoming 32-bit embedded SMP work.

---

 arch/powerpc/include/asm/mmu_context.h |    3 +++
 1 file changed, 3 insertions(+)
arch/powerpc/include/asm/mmu_context.h +3 -0
@@ -186,6 +186,9 @@ static inline void switch_mm(struct mm_s
 
 	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;