LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: jens.axboe@oracle.com, mingo@elte.hu,
jeremy.fitzhardinge@citrix.com, nickpiggin@yahoo.com.au,
torvalds@linux-foundation.org, paulmck@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org, venkatesh.pallipadi@intel.com,
Suresh Siddha <suresh.b.siddha@intel.com>
Subject: [patch 2/3] x86: Add smp_mb() before sending INVALIDATE_TLB_VECTOR
Date: Tue, 04 Nov 2008 13:53:04 -0800 [thread overview]
Message-ID: <20081104215626.897026000@linux-os.sc.intel.com> (raw)
In-Reply-To: <20081104215626.751033000@linux-os.sc.intel.com>
[-- Attachment #1: x86_fix_mb_tlb_flush.patch --]
[-- Type: text/plain, Size: 1468 bytes --]
On x86, x2apic mode accesses for sending IPI's don't have serializing
semantics. If the IPI receiver refers(in lock-free fashion) to some memory setup
by the sender, the need for smp_mb() before sending the IPI becomes critical in
x2apic mode.
Add the smp_mb() in native_flush_tlb_others() before sending the IPI.
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
Index: linux-2.6.git/arch/x86/kernel/tlb_32.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/tlb_32.c 2008-10-13 10:04:12.000000000 -0700
+++ linux-2.6.git/arch/x86/kernel/tlb_32.c 2008-11-04 10:01:16.000000000 -0800
@@ -154,6 +154,12 @@
flush_mm = mm;
flush_va = va;
cpus_or(flush_cpumask, cpumask, flush_cpumask);
+
+ /*
+ * Make the above memory operations globally visible before
+ * sending the IPI.
+ */
+ smp_mb();
/*
* We have to send the IPI only to
* CPUs affected.
Index: linux-2.6.git/arch/x86/kernel/tlb_64.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/tlb_64.c 2008-10-31 11:15:11.000000000 -0700
+++ linux-2.6.git/arch/x86/kernel/tlb_64.c 2008-11-04 10:01:31.000000000 -0800
@@ -183,6 +183,11 @@
cpus_or(f->flush_cpumask, cpumask, f->flush_cpumask);
/*
+ * Make the above memory operations globally visible before
+ * sending the IPI.
+ */
+ smp_mb();
+ /*
* We have to send the IPI only to
* CPUs affected.
*/
--
next prev parent reply other threads:[~2008-11-04 22:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-04 21:53 [patch 1/3] generic-ipi: add smp_mb() before sending the IPI Suresh Siddha
2008-11-04 21:53 ` Suresh Siddha [this message]
2008-11-06 8:42 ` [patch 2/3] x86: Add smp_mb() before sending INVALIDATE_TLB_VECTOR Ingo Molnar
2008-11-06 8:43 ` Jens Axboe
2008-11-04 21:53 ` [patch 3/3] generic-ipi: fix the smp_mb() usage Suresh Siddha
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=20081104215626.897026000@linux-os.sc.intel.com \
--to=suresh.b.siddha@intel.com \
--cc=jens.axboe@oracle.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=paulmck@linux.vnet.ibm.com \
--cc=torvalds@linux-foundation.org \
--cc=venkatesh.pallipadi@intel.com \
--subject='Re: [patch 2/3] x86: Add smp_mb() before sending INVALIDATE_TLB_VECTOR' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).