[patch 3/3] generic-ipi: fix the smp_mb() usage

From: Suresh Siddha
Date: Tue Nov 04 2008 - 17:08:29 EST


Remove the unnecessary smp_mb() in csd_flag_wait(), as the presence of that
smp_mb() doesn't mean anything on the sender, when the ipi receiver is not
doing any thing special (like memory fence) after clearing the CSD_FLAG_WAIT.

IPI receiver (on Alpha atleast) needs smp_read_barrier_depends() in the handler
before reading the call_single_queue list in a lock-free fashion. Replace
the existing smp_mb() (which is unnecessary) with smp_read_barrier_depends()

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

Index: linux-2.6.git/kernel/smp.c
===================================================================
--- linux-2.6.git.orig/kernel/smp.c 2008-11-04 09:54:29.000000000 -0800
+++ linux-2.6.git/kernel/smp.c 2008-11-04 10:04:54.000000000 -0800
@@ -51,10 +51,6 @@
{
/* Wait for response */
do {
- /*
- * We need to see the flags store in the IPI handler
- */
- smp_mb();
if (!(data->flags & CSD_FLAG_WAIT))
break;
cpu_relax();
@@ -162,7 +158,7 @@
* Need to see other stores to list head for checking whether
* list is empty without holding q->lock
*/
- smp_mb();
+ smp_read_barrier_depends();
while (!list_empty(&q->list)) {
unsigned int data_flags;

@@ -196,7 +192,7 @@
/*
* See comment on outer loop
*/
- smp_mb();
+ smp_read_barrier_depends();
}
}


--

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/