diff options
author | Kirill Tkhai <tkhai@yandex.ru> | 2013-04-08 16:29:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-08 22:50:47 -0400 |
commit | 07df841877195765d958df146f614fc7bdedd5e3 (patch) | |
tree | 9c749251ab90cd88b42f98c42e652f9b75b425b9 /arch/sparc/mm | |
parent | 598ec971ddcf7dcb0c381230e69a39c75b7fac1a (diff) |
sparc64: Do not save/restore interrupts in get_new_mmu_context()
get_new_mmu_context() is always called with interrupts disabled.
So it's possible to do this micro optimization.
(Also fix the comment to switch_mm, which is called in both cases)
Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: David Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm')
-rw-r--r-- | arch/sparc/mm/init_64.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 076068f4459e..4ccaa1b9961f 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -681,10 +681,9 @@ void get_new_mmu_context(struct mm_struct *mm) | |||
681 | { | 681 | { |
682 | unsigned long ctx, new_ctx; | 682 | unsigned long ctx, new_ctx; |
683 | unsigned long orig_pgsz_bits; | 683 | unsigned long orig_pgsz_bits; |
684 | unsigned long flags; | ||
685 | int new_version; | 684 | int new_version; |
686 | 685 | ||
687 | spin_lock_irqsave(&ctx_alloc_lock, flags); | 686 | spin_lock(&ctx_alloc_lock); |
688 | orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK); | 687 | orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK); |
689 | ctx = (tlb_context_cache + 1) & CTX_NR_MASK; | 688 | ctx = (tlb_context_cache + 1) & CTX_NR_MASK; |
690 | new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx); | 689 | new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx); |
@@ -720,7 +719,7 @@ void get_new_mmu_context(struct mm_struct *mm) | |||
720 | out: | 719 | out: |
721 | tlb_context_cache = new_ctx; | 720 | tlb_context_cache = new_ctx; |
722 | mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits; | 721 | mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits; |
723 | spin_unlock_irqrestore(&ctx_alloc_lock, flags); | 722 | spin_unlock(&ctx_alloc_lock); |
724 | 723 | ||
725 | if (unlikely(new_version)) | 724 | if (unlikely(new_version)) |
726 | smp_new_mmu_context_version(); | 725 | smp_new_mmu_context_version(); |