public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* smp_call_function() deadlock during boot
@ 2002-06-22  2:41 William Lee Irwin III
  0 siblings, 0 replies; only message in thread
From: William Lee Irwin III @ 2002-06-22  2:41 UTC (permalink / raw)
  To: linux-kernel

smp_call_function() gets called before cpu_online_map is initialized.
In order to tolerate this behavior the following appears to be necessary.
This method of resolving the issue has a precedent in smp_IPI_allbutself().

Cheers,
Bill


===== arch/i386/kernel/smp.c 1.17 vs edited =====
--- 1.17/arch/i386/kernel/smp.c	Mon May 20 10:51:17 2002
+++ edited/arch/i386/kernel/smp.c	Fri Jun 21 19:37:11 2002
@@ -567,9 +567,9 @@
  */
 {
 	struct call_data_struct data;
-	int cpus = num_online_cpus()-1;
+	int cpus = num_online_cpus();
 
-	if (!cpus)
+	if (cpus <= 1)
 		return 0;
 
 	data.func = func;
@@ -586,11 +586,11 @@
 	send_IPI_allbutself(CALL_FUNCTION_VECTOR);
 
 	/* Wait for response */
-	while (atomic_read(&data.started) != cpus)
+	while (atomic_read(&data.started) != cpus - 1)
 		barrier();
 
 	if (wait)
-		while (atomic_read(&data.finished) != cpus)
+		while (atomic_read(&data.finished) != cpus - 1)
 			barrier();
 	spin_unlock(&call_lock);
 

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

only message in thread, other threads:[~2002-06-22  2:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-22  2:41 smp_call_function() deadlock during boot William Lee Irwin III

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