lkml.org 
[lkml]   [2009]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 4/5] mce-inject: no wait on write with MCE_INJ_CTX_RANDOM
Skip schedule_timeout() on write with MCE_INJ_CTX_RANDOM.
And call raise_mce() only when it is required.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
---
arch/x86/kernel/cpu/mcheck/mce-inject.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index 702f712..7691c52 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -149,12 +149,11 @@ static int raise_local(void)

static void raise_mce(struct mce *m)
{
- int context = MCE_INJ_CTX(m->inject_flags);
-
- inject_mce(m);
-
- if (context == MCE_INJ_CTX_RANDOM)
- return;
+ /*
+ * Need to give user space some time to set everything up,
+ * so do it a jiffie or two later everywhere.
+ */
+ schedule_timeout(2);

#ifdef CONFIG_X86_LOCAL_APIC
if (m->inject_flags & MCE_INJ_NMI_BROADCAST) {
@@ -212,12 +211,12 @@ static ssize_t mce_write(struct file *filp, const char __user *ubuf,
if (m.extcpu >= num_possible_cpus() || !cpu_online(m.extcpu))
return -EINVAL;

- /*
- * Need to give user space some time to set everything up,
- * so do it a jiffie or two later everywhere.
- */
- schedule_timeout(2);
- raise_mce(&m);
+ /* Copy to percpu */
+ inject_mce(&m);
+
+ if (MCE_INJ_CTX(m.inject_flags) != MCE_INJ_CTX_RANDOM)
+ raise_mce(&m);
+
return usize;
}

--
1.6.4.3



\
 
 \ /
  Last update: 2009-09-28 08:57    [W:0.151 / U:1.540 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site