From: Daniel Walker <dwalker@mvista.com>
To: eranian@hpl.hp.com
Cc: "Björn Steinbrink" <B.Steinbrink@gmx.de>,
ak@suse.de, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: nmi_watchdog=2 regression in 2.6.21
Date: Tue, 28 Aug 2007 13:13:44 -0700 [thread overview]
Message-ID: <1188332024.2435.328.camel@dhcp193.mvista.com> (raw)
In-Reply-To: <20070828194636.GB2814@frankl.hpl.hp.com>
On Tue, 2007-08-28 at 12:46 -0700, Stephane Eranian wrote:
> I think I found the problem. As I suspected, it seems there is an assymetry
> between the 1st end 2nd counter (just like what they have on P6 core). Yet
> for architectural perfmon v1, this restriction is supposed to be lifted.
>
> Unfortunately, a quick look at the errata document at
> http://download.intel.com/design/mobile/SPECUPDT/30922212.pdf
>
> for Core Duo shows bugs A49 as 'nofix':
> Core Duo processor has a bug which renders the enable bit (22) of
> PERFEVTSEL1 inoperative. The processor behaves like former P6 cores,
> the enable bit of PERFEVTSEL0 controls the activation of both counters
Your patch switched the nmi from PERFEVTSEL0 to PERFEVTSEL1 (right?)..
So 0 works, 1 does not , for me anyway ..
> That explains why you get the 'NMI stuck' message when using PERFEVTSEL1.
> I suspect when using PERFEVTSEL0, then NMI watchdog is not stuck. So it
> is possible that in case NMI is stuck the code does not cleanly shutdown the
> NMI interrupt and you get some spurious NMI interrupt later in the boot at
> you are stuck because you are holding a lock. We need to look at the error
> path of check_nmi_watchdog(). I glance through it and could not find the place
> where the APIC vector is cleared.
As far as I can tell the check_nmi_watchdog() doesn't take locks, and it
can't safely share a lock with the NMI ..
The patch below fixes the hang (not the stuck NMI) .. Not totally sure
why, but the cpus are stuck in a loop waiting for the endflag which
never comes .. This also plays with the nmi hz which might do
something.. /proc/interrupt doesn't show any nmi's either..
Daniel
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Index: linux-2.6.22/arch/i386/kernel/nmi.c
===================================================================
--- linux-2.6.22.orig/arch/i386/kernel/nmi.c 2007-08-15 00:51:12.000000000 +0000
+++ linux-2.6.22/arch/i386/kernel/nmi.c 2007-08-28 20:15:04.000000000 +0000
@@ -82,7 +82,7 @@ static __init void nmi_cpu_busy(void *da
static int __init check_nmi_watchdog(void)
{
unsigned int *prev_nmi_count;
- int cpu;
+ int cpu, ret = 0;
if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT))
return 0;
@@ -125,18 +125,18 @@ static int __init check_nmi_watchdog(voi
if (!atomic_read(&nmi_active)) {
kfree(prev_nmi_count);
atomic_set(&nmi_active, -1);
- return -1;
- }
+ printk("nmi malfunctioning.\n");
+ ret = -1;
+ } else
+ printk("OK.\n");
endflag = 1;
- printk("OK.\n");
-
/* now that we know it works we can reduce NMI frequency to
something more reasonable; makes a difference in some configs */
if (nmi_watchdog == NMI_LOCAL_APIC)
nmi_hz = lapic_adjust_nmi_hz(1);
kfree(prev_nmi_count);
- return 0;
+ return ret;
}
/* This needs to happen later in boot so counters are working */
late_initcall(check_nmi_watchdog);
next prev parent reply other threads:[~2007-08-28 20:23 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-08 0:06 Daniel Walker
2007-08-08 14:20 ` Björn Steinbrink
2007-08-08 15:20 ` Daniel Walker
2007-08-20 16:44 ` Daniel Walker
2007-08-23 20:08 ` Michal Piotrowski
2007-08-23 21:22 ` Daniel Walker
2007-08-27 0:45 ` Who wants to maintain KR list for stable releases? (was Re: nmi_watchdog=2 regression in 2.6.21) Michal Piotrowski
2007-08-27 7:51 ` Andrew Morton
2007-08-27 9:41 ` Jeff Garzik
2007-08-27 11:35 ` Michal Piotrowski
2007-08-27 16:09 ` Adrian Bunk
2007-08-27 16:05 ` Daniel Walker
2007-08-27 11:38 ` Michal Piotrowski
2007-08-27 12:35 ` Rafael J. Wysocki
2007-08-27 15:02 ` Michal Piotrowski
2007-08-27 15:13 ` Daniel Walker
2007-08-27 15:26 ` Michal Piotrowski
2007-08-27 15:39 ` Daniel Walker
2007-08-27 17:02 ` Michal Piotrowski
2007-08-27 17:17 ` Daniel Walker
2007-08-27 19:12 ` David Rees
2007-08-29 7:42 ` Natalie Protasevich
2007-08-29 22:23 ` Adrian Bunk
2007-08-29 23:59 ` Natalie Protasevich
2007-08-30 8:51 ` Adrian Bunk
2007-08-30 15:24 ` Who wants to maintain KR list for stable releases? Stefan Richter
[not found] ` <32209efe0708300950r5787402l4d02cedd862314fd@mail.gmail.com>
2007-08-30 22:11 ` Al Boldi
2007-09-03 12:29 ` Adrian Bunk
2007-09-03 13:20 ` Stefan Richter
2007-08-30 15:54 ` Who wants to maintain KR list for stable releases? (was Re: nmi_watchdog=2 regression in 2.6.21) Bill Davidsen
2007-09-03 12:43 ` Adrian Bunk
2007-08-27 16:26 ` Daniel Walker
2007-08-27 16:44 ` Andrew Morton
2007-08-27 16:52 ` Adrian Bunk
2007-08-27 17:08 ` Daniel Walker
2007-08-27 18:26 ` Andrew Morton
2007-08-27 8:11 ` David Rees
2007-08-27 11:42 ` Michal Piotrowski
2007-08-27 14:39 ` Daniel Walker
2007-08-27 15:11 ` Michal Piotrowski
2007-08-27 17:54 ` nmi_watchdog=2 regression in 2.6.21 Stephane Eranian
2007-08-27 17:55 ` Daniel Walker
2007-08-27 22:55 ` Stephane Eranian
2007-08-27 23:07 ` Daniel Walker
2007-08-28 9:12 ` Stephane Eranian
2007-08-28 14:34 ` Daniel Walker
2007-08-28 17:05 ` Stephane Eranian
2007-08-28 18:30 ` Daniel Walker
2007-08-28 19:46 ` Stephane Eranian
2007-08-28 20:13 ` Daniel Walker [this message]
2007-08-29 21:24 ` Stephane Eranian
2007-08-30 1:21 ` Daniel Walker
2007-08-30 21:05 ` Stephane Eranian
2007-08-31 14:43 ` Daniel Walker
2007-08-31 16:21 ` Stephane Eranian
2007-08-31 16:35 ` Daniel Walker
2007-08-31 18:06 ` Björn Steinbrink
2007-09-01 0:24 ` Daniel Walker
2007-09-01 1:00 ` Björn Steinbrink
2007-09-01 1:36 ` Daniel Walker
2007-09-01 10:19 ` Andi Kleen
2007-09-01 19:51 ` Stephane Eranian
2007-09-01 20:32 ` Andi Kleen
2007-09-01 20:46 ` Daniel Walker
2007-09-01 9:12 ` Andi Kleen
2007-08-28 20:26 ` Daniel Walker
2007-08-28 20:21 ` Stephane Eranian
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=1188332024.2435.328.camel@dhcp193.mvista.com \
--to=dwalker@mvista.com \
--cc=B.Steinbrink@gmx.de \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=eranian@hpl.hp.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
all inboxes | Powered by JetHome®