mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: [PATCH] 2.5.48 s390 (10/16): flushtlb bug.
Date: Mon, 18 Nov 2002 20:21:12 +0100	[thread overview]
Message-ID: <200211182021.12385.schwidefsky@de.ibm.com> (raw)

Don't set cpu_vm_mask if the mm isn't exclusive to the cpu.

diff -urN linux-2.5.48/include/asm-s390/tlbflush.h linux-2.5.48-s390/include/asm-s390/tlbflush.h
--- linux-2.5.48/include/asm-s390/tlbflush.h	Mon Nov 18 05:29:57 2002
+++ linux-2.5.48-s390/include/asm-s390/tlbflush.h	Mon Nov 18 20:11:48 2002
@@ -91,13 +91,15 @@
 
 static inline void __flush_tlb_mm(struct mm_struct * mm)
 {
-	if (((atomic_read(&mm->mm_count) != 1) ||
-	     (mm->cpu_vm_mask != (1UL << smp_processor_id())))) {
-		mm->cpu_vm_mask = (1UL << smp_processor_id());
+	if (mm->cpu_vm_mask != (1UL << smp_processor_id())) {
+		/* mm was active on more than one cpu. */
+		if (mm == current->active_mm &&
+		    atomic_read(&mm->mm_count) == 1)
+			/* this cpu is the only one using the mm. */
+			mm->cpu_vm_mask = 1UL << smp_processor_id();
 		global_flush_tlb();
-	} else {                 
+	} else
 		local_flush_tlb();
-	}
 }
 
 static inline void flush_tlb(void)
diff -urN linux-2.5.48/include/asm-s390x/tlbflush.h linux-2.5.48-s390/include/asm-s390x/tlbflush.h
--- linux-2.5.48/include/asm-s390x/tlbflush.h	Mon Nov 18 05:29:50 2002
+++ linux-2.5.48-s390/include/asm-s390x/tlbflush.h	Mon Nov 18 20:11:48 2002
@@ -88,13 +88,15 @@
 
 static inline void __flush_tlb_mm(struct mm_struct * mm)
 {
-	if (((atomic_read(&mm->mm_count) != 1) ||
-	     (mm->cpu_vm_mask != (1UL << smp_processor_id())))) {
-		mm->cpu_vm_mask = (1UL << smp_processor_id());
+	if (mm->cpu_vm_mask != (1UL << smp_processor_id())) {
+		/* mm was active on more than one cpu. */
+		if (mm == current->active_mm &&
+		    atomic_read(&mm->mm_count) == 1)
+			/* this cpu is the only one using the mm. */
+			mm->cpu_vm_mask = 1UL << smp_processor_id();
 		global_flush_tlb();
-	} else {                 
+	} else
 		local_flush_tlb();
-	}
 }
 
 static inline void flush_tlb(void)


                 reply	other threads:[~2002-11-18 19:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200211182021.12385.schwidefsky@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®