Skip to content

Commit

Permalink
parisc: Optimize switch_mm
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John David Anglin authored and Helge Deller committed Aug 22, 2017
1 parent 42593e7 commit d2883fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/parisc/include/asm/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d2883fa

Please sign in to comment.