linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Hannes Reinecke <Hannes.Reinecke@suse.de>
Cc: Dave Hansen <haveblue@us.ibm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Dumb question: BKL on reboot ?
Date: Thu, 21 Aug 2003 18:58:41 +0200	[thread overview]
Message-ID: <20030821165841.GH29612@dualathlon.random> (raw)
In-Reply-To: <20030821163938.GG29612@dualathlon.random>

On Thu, Aug 21, 2003 at 06:39:38PM +0200, Andrea Arcangeli wrote:
> static void do_machine_restart(void * __unused)
> {
> 	clear_bit(smp_processor_id(), &cpu_restart_map);
> 	if (smp_processor_id() == 0) {
> 	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> if the `reboot` program doesn't run by luck on cpu 0, it will be the one
> that will hang instead of the others. the above check must be changed to:
> 
> 	smp_processor_id() == reboot_cpu
> 
> and you should snapshot reboot_cpu in machine_restart_smp. then it won't
> hang anymore.

this untested patch should do the trick:

--- 2.4.22pre7aa1/arch/s390x/kernel/smp.c.~1~	2003-07-19 02:34:04.000000000 +0200
+++ 2.4.22pre7aa1/arch/s390x/kernel/smp.c	2003-08-21 18:48:05.000000000 +0200
@@ -240,11 +240,12 @@ void smp_send_stop(void)
  * Reboot, halt and power_off routines for SMP.
  */
 static volatile unsigned long cpu_restart_map;
+static unsigned long restart_cpu;
 
 static void do_machine_restart(void * __unused)
 {
 	clear_bit(smp_processor_id(), &cpu_restart_map);
-	if (smp_processor_id() == 0) {
+	if (smp_processor_id() == restart_cpu) {
 		/* Wait for all other cpus to enter do_machine_restart. */
 		while (cpu_restart_map != 0);
 		/* Store status of other cpus. */
@@ -263,6 +264,7 @@ static void do_machine_restart(void * __
 
 void machine_restart_smp(char * __unused) 
 {
+	restart_cpu = smp_processor_id();
 	cpu_restart_map = cpu_online_map;
         smp_call_function(do_machine_restart, NULL, 0, 0);
 	do_machine_restart(NULL);

Andrea

  reply	other threads:[~2003-08-21 16:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-20 10:22 Dumb question: BKL on reboot ? Hannes Reinecke
2003-08-20 18:29 ` Andrew Morton
2003-08-20 18:35   ` David S. Miller
2003-08-20 20:23     ` Dave Hansen
2003-08-21  8:05       ` Hannes Reinecke
2003-08-21 15:41         ` Andrea Arcangeli
2003-08-21 15:55           ` Hannes Reinecke
2003-08-21 16:39             ` Andrea Arcangeli
2003-08-21 16:58               ` Andrea Arcangeli [this message]
2003-08-22  6:39               ` Hannes Reinecke
2003-08-22 13:57                 ` Andrea Arcangeli
2003-08-24 21:43                 ` Andrea Arcangeli
2003-08-21 15:33       ` Andrea Arcangeli
     [not found] <3F434BD1.9050704@suse.de.suse.lists.linux.kernel>
2003-08-20 10:49 ` Andi Kleen
2003-08-20 11:51   ` Hannes Reinecke
2003-08-20 12:03     ` Andi Kleen

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=20030821165841.GH29612@dualathlon.random \
    --to=andrea@suse.de \
    --cc=Hannes.Reinecke@suse.de \
    --cc=haveblue@us.ibm.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;
as well as URLs for NNTP newsgroup(s).