From: John David Anglin Date: Wed, 26 Jul 2017 18:02:52 +0000 (+0200) Subject: parisc: Optimize switch_mm X-Git-Tag: v4.14-rc1~154^2~20 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=d2883fa1a6fcb065362f27f410114dc6b7084655;p=linux-block.git 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 --- diff --git a/arch/parisc/include/asm/mmu_context.h b/arch/parisc/include/asm/mmu_context.h index a81226257878..e4a657094058 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);