All of lore.kernel.org
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: Parisc List <linux-parisc@vger.kernel.org>
Cc: Helge Deller <deller@gmx.de>,
	James Bottomley <James.Bottomley@HansenPartnership.com>
Subject: [PATCH] parisc: Optimize switch_mm
Date: Tue, 25 Jul 2017 17:31:41 -0400	[thread overview]
Message-ID: <16F63B59-7A36-48F0-A5C7-670CA2ED9DED@bell.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

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>



[-- Attachment #2: mmu_context.h.d.txt --]
[-- Type: text/plain, Size: 988 bytes --]

diff --git a/arch/parisc/include/asm/mmu_context.h b/arch/parisc/include/asm/mmu_context.h
index a81226257878..b1dc6e3f0dd0 100644
--- a/arch/parisc/include/asm/mmu_context.h
+++ b/arch/parisc/include/asm/mmu_context.h
@@ -49,26 +49,19 @@ static inline void load_context(mm_context_t context)
 	mtctl(__space_to_prot(context), 8);
 }
 
-static inline void switch_mm_irqs_off(struct mm_struct *prev,
+static inline void switch_mm(struct mm_struct *prev,
 		struct mm_struct *next, struct task_struct *tsk)
 {
+	unsigned long flags;
+
 	if (prev != next) {
+		local_irq_save(flags);
 		mtctl(__pa(next->pgd), 25);
 		load_context(next->context);
+		local_irq_restore(flags);
 	}
 }
 
-static inline void switch_mm(struct mm_struct *prev,
-		struct mm_struct *next, struct task_struct *tsk)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	switch_mm_irqs_off(prev, next, tsk);
-	local_irq_restore(flags);
-}
-#define switch_mm_irqs_off switch_mm_irqs_off

             reply	other threads:[~2017-07-25 21:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-25 21:31 John David Anglin [this message]
2017-07-26 18:02 ` [PATCH] parisc: Optimize switch_mm Helge Deller
2017-07-26 18:49   ` John David Anglin
2017-07-26 19:13     ` Helge Deller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16F63B59-7A36-48F0-A5C7-670CA2ED9DED@bell.net \
    --to=dave.anglin@bell.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=deller@gmx.de \
    --cc=linux-parisc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.