linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Luck <tony.luck@intel.com>
To: Chen Gong <gong.chen@linux.intel.com>
Cc: bp@amd64.org, x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/6] x86/mce: Provide an option to keep cmci_reenable() quiet
Date: Tue, 7 Aug 2012 13:46:56 -0700	[thread overview]
Message-ID: <2afe0125e4a9724f9cf22f03b0a1747ce67cdc8c.1344379657.git.tony.luck@intel.com> (raw)
In-Reply-To: <20120806214336.GA11726@gchen.bj.intel.com>

cmci_reenable() calls cmci_discover() to look at which machine check
banks are shared between processors. It ensure that only one cpu takes
ownership of each shared bank. At boot time cmci_discover() is muted,
but during hot add events it provides some output which may be helpful
to ensure that all banks have an owner.

We want to use cmci_reenable() when a CMCI storm subsides. In this case
the topology has not changed, so we do not need any commentary as it
goes about its business.

Add a "quiet" argument to cmci_reenable() that it passes to cmci_discover().

Signed-off-by: Tony Luck <tony.luck@intel.com>
---

[Patches 1-4 remain as previously posted. This is a new patch to
 help tidy console messages. Old patch 5 becomes patch 6 (and has
 a few cleanups]

 arch/x86/include/asm/mce.h             |  4 ++--
 arch/x86/kernel/cpu/mcheck/mce.c       |  4 ++--
 arch/x86/kernel/cpu/mcheck/mce_intel.c | 10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 441520e..bf79a0f 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -165,13 +165,13 @@ extern int mce_cmci_disabled;
 extern int mce_ignore_ce;
 void mce_intel_feature_init(struct cpuinfo_x86 *c);
 void cmci_clear(void);
-void cmci_reenable(void);
+void cmci_reenable(int quiet);
 void cmci_rediscover(int dying);
 void cmci_recheck(void);
 #else
 static inline void mce_intel_feature_init(struct cpuinfo_x86 *c) { }
 static inline void cmci_clear(void) {}
-static inline void cmci_reenable(void) {}
+static inline void cmci_reenable(int quiet) {}
 static inline void cmci_rediscover(int dying) {}
 static inline void cmci_recheck(void) {}
 #endif
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index b4dde15..826dd21 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1994,7 +1994,7 @@ static void mce_enable_ce(void *all)
 {
 	if (!mce_available(__this_cpu_ptr(&cpu_info)))
 		return;
-	cmci_reenable();
+	cmci_reenable(0);
 	cmci_recheck();
 	if (all)
 		__mcheck_cpu_init_timer();
@@ -2246,7 +2246,7 @@ static void __cpuinit mce_reenable_cpu(void *h)
 		return;
 
 	if (!(action & CPU_TASKS_FROZEN))
-		cmci_reenable();
+		cmci_reenable(0);
 	for (i = 0; i < banks; i++) {
 		struct mce_bank *b = &mce_banks[i];
 
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c
index 38e49bc..e652cde 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_intel.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c
@@ -78,7 +78,7 @@ static void print_update(char *type, int *hdr, int num)
  * on this CPU. Use the algorithm recommended in the SDM to discover shared
  * banks.
  */
-static void cmci_discover(int banks, int boot)
+static void cmci_discover(int banks, int quiet)
 {
 	unsigned long *owned = (void *)&__get_cpu_var(mce_banks_owned);
 	unsigned long flags;
@@ -96,7 +96,7 @@ static void cmci_discover(int banks, int boot)
 
 		/* Already owned by someone else? */
 		if (val & MCI_CTL2_CMCI_EN) {
-			if (test_and_clear_bit(i, owned) && !boot)
+			if (test_and_clear_bit(i, owned) && !quiet)
 				print_update("SHD", &hdr, i);
 			__clear_bit(i, __get_cpu_var(mce_poll_banks));
 			continue;
@@ -109,7 +109,7 @@ static void cmci_discover(int banks, int boot)
 
 		/* Did the enable bit stick? -- the bank supports CMCI */
 		if (val & MCI_CTL2_CMCI_EN) {
-			if (!test_and_set_bit(i, owned) && !boot)
+			if (!test_and_set_bit(i, owned) && !quiet)
 				print_update("CMCI", &hdr, i);
 			__clear_bit(i, __get_cpu_var(mce_poll_banks));
 		} else {
@@ -196,11 +196,11 @@ void cmci_rediscover(int dying)
 /*
  * Reenable CMCI on this CPU in case a CPU down failed.
  */
-void cmci_reenable(void)
+void cmci_reenable(int quiet)
 {
 	int banks;
 	if (cmci_supported(&banks))
-		cmci_discover(banks, 0);
+		cmci_discover(banks, quiet);
 }
 
 static void intel_init_cmci(void)
-- 
1.7.10.2.552.gaa3bb87


  reply	other threads:[~2012-08-07 23:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 17:59 [RESEND PATCH 0/5 V2] x86: mce: Bugfixes, cleanups and a new CMCI poll version Chen Gong
2012-07-19 17:59 ` [PATCH 1/5] x86: mce: Disable preemption when calling raise_local() Chen Gong
2012-07-19 17:59 ` [PATCH 2/5] x86: mce: Serialize mce injection Chen Gong
2012-07-19 17:59 ` [PATCH 3/5] x86: mce: Split timer init Chen Gong
2012-07-19 17:59 ` [PATCH 4/5] x86: mce: Remove the frozen cases in the hotplug code Chen Gong
2012-07-19 17:59 ` [PATCH 5/5] x86: mce: Add cmci poll mode Chen Gong
2012-08-01  0:56 ` [RESEND PATCH 0/5 V2] x86: mce: Bugfixes, cleanups and a new CMCI poll version Chen Gong
2012-08-01  9:15   ` Borislav Petkov
2012-08-03 22:29   ` Luck, Tony
2012-08-06 21:43     ` Chen Gong
2012-08-07 20:46       ` Tony Luck [this message]
2012-08-07 22:15         ` [PATCH 6/6] x86/mce: Add CMCI poll mode Tony Luck
2012-08-09 17:59         ` [PATCH 5/6] x86/mce: Make cmci_discover() quiet Tony Luck

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=2afe0125e4a9724f9cf22f03b0a1747ce67cdc8c.1344379657.git.tony.luck@intel.com \
    --to=tony.luck@intel.com \
    --cc=bp@amd64.org \
    --cc=gong.chen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).