From d2883fa1a6fcb065362f27f410114dc6b7084655 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Wed, 26 Jul 2017 20:02:52 +0200 Subject: 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 Signed-off-by: Helge Deller --- arch/parisc/include/asm/mmu_context.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch') diff --git a/arch/parisc/include/asm/mmu_context.h b/arch/parisc/include/asm/mmu_context.h index a812262..e4a6570 100644 --- a/arch/parisc/include/asm/mmu_context.h +++ b/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); -- cgit v1.1