public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Subject: smp_call_function() deadlock during boot
Date: Fri, 21 Jun 2002 19:41:40 -0700	[thread overview]
Message-ID: <20020622024140.GD25360@holomorphy.com> (raw)

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);
 

                 reply	other threads:[~2002-06-22  2:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020622024140.GD25360@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox