From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] flush_tlb_mm() bug fix
Date: Thu, 14 Nov 2002 06:12:42 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590709805420@msgid-missing> (raw)
The flush_tlb_mm() routine contained a long-standing bug back from the
days when SMP support was added to ia64 linux. It causes seemingly
random and temporary memory "corruption" when a multi-threaded task
does a fork() on an SMP machine. Note that both a conditions are
required: the bug doesn't trigger on UP machines or when fork() is
called from a single-threaded program. Fortunately, there don't seem
to be all that many programs doing that (OK, if there were more
programs doing that, we would have found the bug earlier...).
A quick patch is below (for the 2.5 tree, 2.4 quick fix is analogous,
except that the change needs to be made in pgalloc.h:flush_tlb_mm()).
A cleaner and (supposedly) better-performing fix is in the 2.5
bitkeeper tree:
http://lia64.bkbits.net:8080/to-linus-2.5/cset@1.867
Thanks to Steve Goldman and Hans Boehm for helping to identify and
track down the bug
Regards,
--david
=== include/asm-ia64/tlbflush.h 1.3 vs edited ==--- 1.3/include/asm-ia64/tlbflush.h Fri Aug 9 17:16:44 2002
+++ edited/include/asm-ia64/tlbflush.h Wed Nov 13 11:47:37 2002
@@ -39,6 +39,11 @@
{
if (mm) {
mm->context = 0;
+#ifdef CONFIG_SMP
+ if (atomic_read(&mm->mm_users) > 1)
+ flush_tlb_all();
+ else
+#endif
if (mm = current->active_mm) {
/* This is called, e.g., as a result of exec(). */
get_new_mmu_context(mm);
reply other threads:[~2002-11-14 6:12 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=marc-linux-ia64-105590709805420@msgid-missing \
--to=davidm@napali.hpl.hp.com \
--cc=linux-ia64@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.