Re: [git pull] scheduler/misc fixes

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Miller
Date: Friday, April 25, 2008 - 12:57 am

From: Peter Zijlstra <a.p.zijlstra@chello.nl>
Date: Fri, 25 Apr 2008 09:48:30 +0200


The equivalent to smp_receive_signal_client() on x86
(smp_reschedule_interrupt) doesn't do an irq_enter() either.

However x86 does do an irq_enter() for smp_call_function() interrupt
handling.

What is the rule in these cases?

Anyways, does the following patch fix the problem?

diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 524b889..bf4ef84 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -866,14 +866,21 @@ void smp_call_function_client(int irq, struct pt_regs *regs)
 	void *info = call_data->info;
 
 	clear_softint(1 << irq);
+
+	irq_enter();
+
+	if (!call_data->wait) {
+		/* let initiator proceed after getting data */
+		atomic_inc(&call_data->finished);
+	}
+
+	func(info);
+
+	irq_exit();
+
 	if (call_data->wait) {
 		/* let initiator proceed only after completion */
-		func(info);
-		atomic_inc(&call_data->finished);
-	} else {
-		/* let initiator proceed after getting data */
 		atomic_inc(&call_data->finished);
-		func(info);
 	}
 }
 


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[git pull] scheduler/misc fixes, Ingo Molnar, (Thu Apr 24, 3:55 pm)
Re: [git pull] scheduler/misc fixes, David Miller, (Thu Apr 24, 8:46 pm)
Re: [git pull] scheduler/misc fixes, Peter Zijlstra, (Fri Apr 25, 12:48 am)
Re: [git pull] scheduler/misc fixes, David Miller, (Fri Apr 25, 12:57 am)
Re: [git pull] scheduler/misc fixes, Ingo Molnar, (Fri Apr 25, 1:04 am)
Re: [git pull] scheduler/misc fixes, David Miller, (Fri Apr 25, 1:07 am)
Re: [git pull] scheduler/misc fixes, Peter Zijlstra, (Fri Apr 25, 1:13 am)
Re: [git pull] scheduler/misc fixes, Peter Zijlstra, (Fri Apr 25, 1:24 am)
Re: [git pull] scheduler/misc fixes, David Miller, (Fri Apr 25, 1:30 am)
Re: [git pull] scheduler/misc fixes, Peter Zijlstra, (Fri Apr 25, 3:19 am)
Re: [git pull] scheduler/misc fixes, Ingo Molnar, (Fri Apr 25, 3:51 am)
Re: [git pull] scheduler/misc fixes, David Miller, (Fri Apr 25, 1:07 pm)
Re: [git pull] scheduler/misc fixes, Thomas Gleixner, (Sun Apr 27, 11:05 am)