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 17:41:13 +0200	[thread overview]
Message-ID: <20030821154113.GE29612@dualathlon.random> (raw)
In-Reply-To: <3F447D40.5020000@suse.de>

On Thu, Aug 21, 2003 at 10:05:20AM +0200, Hannes Reinecke wrote:
> Dave Hansen wrote:
> [ .. ]
> >
> >Or, are you saying that a CPU could have the BKL, and have
> >stop_this_cpu() called on it?  I guess we could add
> >release_kernel_lock() to stop_this_cpu().
> Exactly what happened here. CPU#1 entered sys_reboot, got BKL and 
> prepared to stop. It will never release BKL, leaving a nice big window 
> for CPU#0 to deadlock.

if that was really the case it shouldn't deadlock, because CPU0
shouldn't depend on a big kernel lock to be able to re-enable the irqs,
and to receive the IPI. Nor any IPI handler could ever be allowed to
take the big kernel lock.

Unless you can demonstrate a dependency on the big kernel lock for CPU0
to re-enable the irqs eventually, I can't see how the above could
deadlock.

The only clear deadlock prone thing I can see from the code is the IPI
handler looping forever w/o allowing the stopped cpu to release all its
underlying spinlocks. Not sure exactly how this generates the deadlock
in practice, but you only need to hit one of the held spinlocks
(including possibly the BKL) in the context of the reboot "cpu" to hang
forever during reboot. Looping forever and giving the OK to reboot the
machine from the context of a kernel thread instead of an IPI will fix
it as far as I can tell.

Andrea

  reply	other threads:[~2003-08-21 15:40 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 [this message]
2003-08-21 15:55           ` Hannes Reinecke
2003-08-21 16:39             ` Andrea Arcangeli
2003-08-21 16:58               ` Andrea Arcangeli
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=20030821154113.GE29612@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).