From: "Chen, Gong" <gong.chen@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: tony.luck@intel.com, "Chen, Gong" <gong.chen@linux.intel.com>,
Borislav Petkov <bp@suse.de>
Subject: [PATCH 2/4 Rebase] x86, MCE: Don't use percpu for MCE workqueue/irq_work
Date: Wed, 20 May 2015 15:35:36 -0400 [thread overview]
Message-ID: <1432150538-3120-3-git-send-email-gong.chen@linux.intel.com> (raw)
In-Reply-To: <1432150538-3120-1-git-send-email-gong.chen@linux.intel.com>
An MCE is considered a rare event. Therefore, there's no need to have
per-CPU instances of both normal and IRQ workqueues. Make them both
global.
Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
Link: http://lkml.kernel.org/r/1406797523-28710-3-git-send-email-gong.chen@linux.intel.com
[Boris: massage commit message]
Signed-off-by: Borislav Petkov <bp@suse.de>
---
arch/x86/kernel/cpu/mcheck/mce.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index ba91777a7ad8..6c064245f802 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -107,7 +107,8 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
*/
mce_banks_t mce_banks_ce_disabled;
-static DEFINE_PER_CPU(struct work_struct, mce_work);
+static struct work_struct mce_work;
+static struct irq_work mce_irq_work;
static void (*quirk_no_way_out)(int bank, struct mce *m, struct pt_regs *regs);
@@ -523,11 +524,9 @@ int mce_available(struct cpuinfo_x86 *c)
static void mce_schedule_work(void)
{
if (!mce_ring_empty())
- schedule_work(this_cpu_ptr(&mce_work));
+ schedule_work(&mce_work);
}
-static DEFINE_PER_CPU(struct irq_work, mce_irq_work);
-
static void mce_irq_work_cb(struct irq_work *entry)
{
mce_notify_irq();
@@ -548,7 +547,7 @@ static void mce_report_event(struct pt_regs *regs)
return;
}
- irq_work_queue(this_cpu_ptr(&mce_irq_work));
+ irq_work_queue(&mce_irq_work);
}
/*
@@ -1710,8 +1709,8 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
__mcheck_cpu_init_generic();
__mcheck_cpu_init_vendor(c);
__mcheck_cpu_init_timer();
- INIT_WORK(this_cpu_ptr(&mce_work), mce_process_work);
- init_irq_work(this_cpu_ptr(&mce_irq_work), &mce_irq_work_cb);
+ INIT_WORK(&mce_work, mce_process_work);
+ init_irq_work(&mce_irq_work, mce_irq_work_cb);
}
/*
--
2.3.2
next prev parent reply other threads:[~2015-05-20 6:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 19:35 MCE ring buffer management (Rebase) Chen, Gong
2015-05-20 19:35 ` [PATCH 1/4 Rebase] x86, MCE: Provide a lock-less memory pool to save error record Chen, Gong
2015-05-20 10:36 ` Borislav Petkov
2015-05-22 21:06 ` Chen, Gong
2015-05-22 8:17 ` Borislav Petkov
2015-05-20 19:35 ` Chen, Gong [this message]
2015-05-20 19:35 ` [PATCH 3/4 Rebase] x86, MCE: Remove mce_ring for SRAO error Chen, Gong
2015-05-20 19:35 ` [PATCH 4/4 Rebase] x86, MCE: Avoid potential deadlock in MCE context Chen, Gong
2015-05-20 9:28 ` Borislav Petkov
2015-05-22 21:12 ` Chen, Gong
2015-05-22 9:09 ` Borislav Petkov
2015-06-08 13:41 ` Borislav Petkov
2015-06-08 20:03 ` Luck, Tony
2015-06-08 20:26 ` Borislav Petkov
2015-06-11 8:27 ` Borislav Petkov
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=1432150538-3120-3-git-send-email-gong.chen@linux.intel.com \
--to=gong.chen@linux.intel.com \
--cc=bp@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@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
Powered by JetHome