From: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
To: Huang Ying <ying.huang@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Andi Kleen <ak@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -v5] x86: MCE: Re-implement MCE log ring buffer as per-CPU ring buffer
Date: Thu, 11 Jun 2009 15:43:05 +0900 [thread overview]
Message-ID: <4A30A779.4040101@jp.fujitsu.com> (raw)
In-Reply-To: <1244445115.8361.576.camel@yhuang-dev.sh.intel.com>
Huang Ying wrote:
> Re-implement MCE log ring buffer as per-CPU ring buffer for better
> scalability.
It seems your patch implicitly includes some bug fix for tip/mce3.
Still discussion of generic lockless ring buffer is going on, so how
about dividing the patch into 2 pieces, for improvement and for bug fix?
Maybe improvement part need to be reworked, so I pulled out the bug fix
part from your patch.
If it's all right, I'd like to put this on top of tip/mce3 asap.
Thanks,
H.Seto
==
[PATCH] x86, mce: fix mce printing
- Add print_mce_head() instead of first flag
- Make header to be printed always
- Stop double printing of corrected errors
[ This portion is originate from Huang Ying's patch ]
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
CC: Huang Ying <ying.huang@intel.com>
---
arch/x86/kernel/cpu/mcheck/mce.c | 26 +++++++++++++++-----------
1 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index d4e7b59..6a3127e 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -180,12 +180,8 @@ void mce_log(struct mce *mce)
set_bit(0, ¬ify_user);
}
-static void print_mce(struct mce *m, int *first)
+static void print_mce(struct mce *m)
{
- if (*first) {
- printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
- *first = 0;
- }
printk(KERN_EMERG
"CPU %d: Machine Check Exception: %16Lx Bank %d: %016Lx\n",
m->extcpu, m->mcgstatus, m->bank, m->status);
@@ -208,6 +204,11 @@ static void print_mce(struct mce *m, int *first)
m->apicid);
}
+static void print_mce_head(void)
+{
+ printk(KERN_EMERG "\n" KERN_EMERG "HARDWARE ERROR\n");
+}
+
static void print_mce_tail(void)
{
printk(KERN_EMERG "This is not a software problem!\n"
@@ -234,7 +235,6 @@ static void wait_for_panic(void)
static void mce_panic(char *msg, struct mce *final, char *exp)
{
int i;
- int first = 1;
/*
* Make sure only one CPU runs in machine check panic
@@ -245,23 +245,27 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
bust_spinlocks(1);
console_verbose();
+ print_mce_head();
/* First print corrected ones that are still unlogged */
for (i = 0; i < MCE_LOG_LEN; i++) {
struct mce *m = &mcelog.entry[i];
- if ((m->status & MCI_STATUS_VAL) &&
- !(m->status & MCI_STATUS_UC))
- print_mce(m, &first);
+ if (!(m->status & MCI_STATUS_VAL))
+ continue;
+ if (!(m->status & MCI_STATUS_UC))
+ print_mce(m);
}
/* Now print uncorrected but with the final one last */
for (i = 0; i < MCE_LOG_LEN; i++) {
struct mce *m = &mcelog.entry[i];
if (!(m->status & MCI_STATUS_VAL))
continue;
+ if (!(m->status & MCI_STATUS_UC))
+ continue;
if (!final || memcmp(m, final, sizeof(struct mce)))
- print_mce(m, &first);
+ print_mce(m);
}
if (final)
- print_mce(final, &first);
+ print_mce(final);
if (cpu_missing)
printk(KERN_EMERG "Some CPUs didn't answer in synchronization\n");
print_mce_tail();
--
1.6.3
next prev parent reply other threads:[~2009-06-11 6:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-08 7:11 [PATCH -v5] x86: MCE: Re-implement MCE log ring buffer as per-CPU ring buffer Huang Ying
2009-06-08 7:20 ` Ingo Molnar
2009-06-08 7:30 ` Huang Ying
2009-06-08 7:38 ` Ingo Molnar
2009-06-08 8:26 ` Huang Ying
2009-06-08 8:52 ` Ingo Molnar
2009-06-08 12:01 ` Steven Rostedt
2009-06-11 6:43 ` Hidetoshi Seto [this message]
2009-06-11 6:48 ` Huang Ying
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=4A30A779.4040101@jp.fujitsu.com \
--to=seto.hidetoshi@jp.fujitsu.com \
--cc=ak@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=ying.huang@intel.com \
/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