lkml.org 
[lkml]   [2008]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 1/3] generic-ipi: add smp_mb() before sending the IPI
smp_mb() (to make the memory operations visible globally) is needed before
sending the ipi, if the receiver refers to the data(setup by the sender) in
a lock-free fashion.

On x86, x2apic mode accesses for sending IPI's don't have serializing
semantics. So the need for smp_mb() before sending the IPI becomes more
critical in x2apic mode.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

Index: linux-2.6.git/kernel/smp.c
===================================================================
--- linux-2.6.git.orig/kernel/smp.c 2008-10-31 11:15:11.000000000 -0700
+++ linux-2.6.git/kernel/smp.c 2008-11-04 09:54:29.000000000 -0800
@@ -76,6 +76,11 @@
list_add_tail(&data->list, &dst->list);
spin_unlock_irqrestore(&dst->lock, flags);

+ /*
+ * Make the list addition visible before sending the ipi.
+ */
+ smp_mb();
+
if (ipi)
arch_send_call_function_single_ipi(cpu);

@@ -370,6 +375,11 @@
list_add_tail_rcu(&data->csd.list, &call_function_queue);
spin_unlock_irqrestore(&call_function_lock, flags);

+ /*
+ * Make the list addition visible before sending the ipi.
+ */
+ smp_mb();
+
/* Send a message to all CPUs in the map */
arch_send_call_function_ipi(mask);

--



\
 
 \ /
  Last update: 2008-11-04 23:11    [W:0.036 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site