<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">

on_each_cpu() is tidier, and handles preemption.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/kernel/rcupdate.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff -puN kernel/rcupdate.c~reiser4-rcu-barrier-fix kernel/rcupdate.c
--- 25/kernel/rcupdate.c~reiser4-rcu-barrier-fix	Wed Aug 18 16:53:57 2004
+++ 25-akpm/kernel/rcupdate.c	Wed Aug 18 16:57:42 2004
@@ -139,16 +139,18 @@ static void rcu_barrier_callback(struct 
 		complete(&amp;rcu_barrier_completion);
 }
 
+/*
+ * Called with preemption disabled, and from cross-cpu IRQ context.
+ */
 static void rcu_barrier_func(void *notused)
 {
-	int cpu = get_cpu();
+	int cpu = smp_processor_id();
 	struct rcu_data *rdp = &amp;per_cpu(rcu_data, cpu);
 	struct rcu_head *head;
 
 	head = &amp;rdp-&gt;barrier;
 	atomic_inc(&amp;rcu_barrier_cpu_count);
 	call_rcu(head, rcu_barrier_callback);
-	put_cpu_no_resched();
 }
 
 /**
@@ -161,8 +163,7 @@ void rcu_barrier(void)
 	down(&amp;rcu_barrier_sema);
 	init_completion(&amp;rcu_barrier_completion);
 	atomic_set(&amp;rcu_barrier_cpu_count, 0);
-	rcu_barrier_func(NULL);
-	smp_call_function(rcu_barrier_func, NULL, 0, 1);
+	on_each_cpu(rcu_barrier_func, NULL, 0, 1);
 	wait_for_completion(&amp;rcu_barrier_completion);
 	up(&amp;rcu_barrier_sema);
 }
_
</pre></body></html>