OSDN Git Service

parisc: Optimize switch_mm
authorJohn David Anglin <dave.anglin@bell.net>
Wed, 26 Jul 2017 18:02:52 +0000 (20:02 +0200)
committerHelge Deller <deller@gmx.de>
Tue, 22 Aug 2017 14:34:34 +0000 (16:34 +0200)
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>
arch/parisc/include/asm/mmu_context.h

index a812262..e4a6570 100644 (file)
@@ -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);