public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] list barriers smp-only
@ 2003-03-20 13:09 Dipankar Sarma
  0 siblings, 0 replies; only message in thread
From: Dipankar Sarma @ 2003-03-20 13:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

This patch makes the list macros use smp-only version of the barriers,
no need to hurt UP performance. It got dropped from my list of things
to push long ago.

Thanks
Dipankar


diff -urN linux-2.5.65-base/include/linux/list.h linux-2.5.65-nowmb/include/linux/list.h
--- linux-2.5.65-base/include/linux/list.h	2003-03-18 03:14:07.000000000 +0530
+++ linux-2.5.65-nowmb/include/linux/list.h	2003-03-20 18:33:12.000000000 +0530
@@ -84,7 +84,7 @@
 {
 	new->next = next;
 	new->prev = prev;
-	wmb();
+	smp_wmb();
 	next->prev = new;
 	prev->next = new;
 }
@@ -303,11 +303,11 @@
  */
 #define list_for_each_rcu(pos, head) \
 	for (pos = (head)->next, prefetch(pos->next); pos != (head); \
-        	pos = pos->next, ({ read_barrier_depends(); 0;}), prefetch(pos->next))
+        	pos = pos->next, ({ smp_read_barrier_depends(); 0;}), prefetch(pos->next))
         	
 #define __list_for_each_rcu(pos, head) \
 	for (pos = (head)->next; pos != (head); \
-        	pos = pos->next, ({ read_barrier_depends(); 0;}))
+        	pos = pos->next, ({ smp_read_barrier_depends(); 0;}))
         	
 /**
  * list_for_each_safe_rcu	-	iterate over an rcu-protected list safe
@@ -318,7 +318,7 @@
  */
 #define list_for_each_safe_rcu(pos, n, head) \
 	for (pos = (head)->next, n = pos->next; pos != (head); \
-		pos = n, ({ read_barrier_depends(); 0;}), n = pos->next)
+		pos = n, ({ smp_read_barrier_depends(); 0;}), n = pos->next)
 
 /* 
  * Double linked lists with a single pointer list head. 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-20 12:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-20 13:09 [PATCH] list barriers smp-only Dipankar Sarma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox