[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ACECDA1.7020004@jp.fujitsu.com>
Date: Fri, 09 Oct 2009 14:44:01 +0900
From: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
To: Huang Ying <ying.huang@...el.com>
CC: Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
Andi Kleen <ak@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/4] mce-inject: make raise_global()
Move large block into a function. No code changed.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
---
arch/x86/kernel/cpu/mcheck/mce-inject.c | 73 ++++++++++++++++++-------------
1 files changed, 42 insertions(+), 31 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index a481291..835c072 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -148,6 +148,45 @@ static int raise_local(void)
return ret;
}
+#ifdef CONFIG_X86_LOCAL_APIC
+static void raise_global(void)
+{
+ unsigned long start;
+ int cpu;
+
+ get_online_cpus();
+ mce_inject_cpumask = cpu_online_map;
+ cpu_clear(get_cpu(), mce_inject_cpumask);
+
+ for_each_online_cpu(cpu) {
+ struct mce *m = &per_cpu(mce_fake_banks, cpu).injectm;
+ if (!m->finished || MCE_INJ_CTX(m->inject_flags)
+ != MCE_INJ_CTX_RANDOM)
+ cpu_clear(cpu, mce_inject_cpumask);
+ }
+ /* make sure mce_inject_cpumask is visible on other CPUs */
+ smp_mb();
+
+ if (!cpus_empty(mce_inject_cpumask))
+ apic->send_IPI_mask(&mce_inject_cpumask, NMI_VECTOR);
+
+ start = jiffies;
+ while (!cpus_empty(mce_inject_cpumask)) {
+ if (!time_before(jiffies, start + 2*HZ)) {
+ printk(KERN_ERR
+ "Timeout waiting for mce inject NMI %lx\n",
+ *cpus_addr(mce_inject_cpumask));
+ break;
+ }
+ cpu_relax();
+ }
+ raise_local();
+
+ put_cpu();
+ put_online_cpus();
+}
+#endif
+
static void raise_mce(struct mce *m)
{
/*
@@ -157,37 +196,9 @@ static void raise_mce(struct mce *m)
schedule_timeout(2);
#ifdef CONFIG_X86_LOCAL_APIC
- if (m->inject_flags & MCE_INJ_NMI_BROADCAST) {
- unsigned long start;
- int cpu;
- get_online_cpus();
- mce_inject_cpumask = cpu_online_map;
- cpu_clear(get_cpu(), mce_inject_cpumask);
- for_each_online_cpu(cpu) {
- struct mce *m = &per_cpu(mce_fake_banks, cpu).injectm;
- if (!m->finished || MCE_INJ_CTX(m->inject_flags)
- != MCE_INJ_CTX_RANDOM)
- cpu_clear(cpu, mce_inject_cpumask);
- }
- /* make sure mce_inject_cpumask is visible on other CPUs */
- smp_mb();
-
- if (!cpus_empty(mce_inject_cpumask))
- apic->send_IPI_mask(&mce_inject_cpumask, NMI_VECTOR);
- start = jiffies;
- while (!cpus_empty(mce_inject_cpumask)) {
- if (!time_before(jiffies, start + 2*HZ)) {
- printk(KERN_ERR
- "Timeout waiting for mce inject NMI %lx\n",
- *cpus_addr(mce_inject_cpumask));
- break;
- }
- cpu_relax();
- }
- raise_local();
- put_cpu();
- put_online_cpus();
- } else
+ if (m->inject_flags & MCE_INJ_NMI_BROADCAST)
+ raise_global();
+ else
#endif
raise_local();
}
--
1.6.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists