The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: trond.myklebust@fys.uio.no, tglx@linutronix.de, mingo@redhat.com,
	hpa@zytor.com, linux-kernel@vger.kernel.org
Subject: Re: Linux 2.6.24-rc5 x86 architecture no longer Oopses...
Date: Fri, 21 Dec 2007 01:44:16 +0100	[thread overview]
Message-ID: <20071221004416.GA15922@elte.hu> (raw)
In-Reply-To: <20071220164000.58c43b42.akpm@linux-foundation.org>


* Andrew Morton <akpm@linux-foundation.org> wrote:

> > +		raw_local_irq_save(flags);
> >  		__raw_spin_lock(&die.lock);
> > -		raw_local_save_flags(flags);
> >  		die.lock_owner = smp_processor_id();
> >  		die.lock_owner_depth = 0;
> >  		bust_spinlocks(1);
> > -	}
> > -	else
> > -		raw_local_save_flags(flags);
> > +	} else
> > +		raw_local_irq_save(flags);
> >  
> >  	if (++die.lock_owner_depth < 3) {
> >  		unsigned long esp;
> 
> Looks sane.
> 
> I suppose there's some reason why we can't just use 
> spin_lock_irqsave(). But that reason was either so obvious or so 
> unimportant that a comment was not needed.  Sigh.

bug was introduced via:

  commit 39743c9ef717fd4f2b5583f010115c5f2482b8ae
  Author: Andi Kleen <ak@suse.de>
  Date:   Fri Oct 19 20:35:03 2007 +0200

      x86: use raw locks during oopses

-               spin_lock_irqsave(&die.lock, flags);
+               __raw_spin_lock(&die.lock);
+               raw_local_save_flags(flags);

that is not a correct open-coding of spin_lock_irqsave(): both the 
ordering is wrong (irqs should be disabled _first_), and the wrong 
flags-saving API was used.

so this is a post-2.6.23 regression and the fix is (now) obvious.

	Ingo

  reply	other threads:[~2007-12-21  0:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-20 22:40 Linux 2.6.24-rc5 x86 architecture no longer Oopses Trond Myklebust
2007-12-20 22:54 ` Andrew Morton
2007-12-20 22:56   ` Andrew Morton
2007-12-20 23:06     ` Trond Myklebust
2007-12-21  0:55     ` Rafael J. Wysocki
2007-12-21 10:19       ` Ingo Molnar
2007-12-20 23:04   ` Trond Myklebust
2007-12-20 23:47   ` Ingo Molnar
2007-12-21  0:02     ` Andrew Morton
2007-12-21  0:05       ` Ingo Molnar
2007-12-21  0:19     ` Andrew Morton
2007-12-21  0:30       ` Ingo Molnar
2007-12-21  0:40         ` Andrew Morton
2007-12-21  0:44           ` Ingo Molnar [this message]
2007-12-21 10:27           ` Ingo Molnar
2007-12-21 10:42             ` Andrew Morton
2007-12-21 11:12               ` Ingo Molnar
2007-12-21 11:34                 ` Andrew Morton
2007-12-21 12:31                   ` Ingo Molnar

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=20071221004416.GA15922@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=trond.myklebust@fys.uio.no \
    /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