lkml.org 
[lkml]   [2003]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] RCU - Make barriers SMP-only
Linus,

This patch makes the barriers used in RCU list macros SMP-only avoiding
the unnecessary overhead of atomic operation on UP. Please apply.

Thanks
Dipankar

list.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)


diff -urN linux-2.5.54-base/include/linux/list.h linux-2.5.54-rcu_barriers/include/linux/list.h
--- linux-2.5.54-base/include/linux/list.h 2003-01-02 08:50:59.000000000 +0530
+++ linux-2.5.54-rcu_barriers/include/linux/list.h 2003-01-03 14:27:21.000000000 +0530
@@ -83,7 +83,7 @@
{
new->next = next;
new->prev = prev;
- wmb();
+ smp_wmb();
next->prev = new;
prev->next = new;
}
@@ -302,11 +302,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
@@ -317,7 +317,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)

#else
#warning "don't include kernel headers in userspace"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.036 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site