浏览代码

parisc: Optimize switch_mm

We only need to switch contexts when prev != next, and we don't need to
disable interrupts to do the check.

Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
John David Anglin 8 年之前
父节点
当前提交
d2883fa1a6
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      arch/parisc/include/asm/mmu_context.h

+ 3 - 0
arch/parisc/include/asm/mmu_context.h

@@ -63,6 +63,9 @@ static inline void switch_mm(struct mm_struct *prev,
 {
 	unsigned long flags;
 
+	if (prev == next)
+		return;
+
 	local_irq_save(flags);
 	switch_mm_irqs_off(prev, next, tsk);
 	local_irq_restore(flags);