Linux EDAC development
 help / color / mirror / Atom feed
* [RFC PATCH] mce: prevent concurrent polling of MCE events
@ 2023-01-16 20:01 Aristeu Rozanski
  2023-01-17 17:42 ` Luck, Tony
  0 siblings, 1 reply; 10+ messages in thread
From: Aristeu Rozanski @ 2023-01-16 20:01 UTC (permalink / raw)
  To: Tony Luck, Borislav Petkov; +Cc: linux-edac, aris

I've considered creating an array so there'd be one lock per package but
that'd add excessive complexity for something that happens by default every
5 minutes. Thoughts?

---------

Error injection in modern HP machines with CMCI disabled will cause the
injected MCE to be found only by polling. Because these newer machines have a
big number of CPUs per package, it makes a lot more likely for multiple
CPUs polling IMC registers (that are shared in the same package) at same time,
causing multiple reports of the same MCE.

Signed-off-by: Aristeu Rozanski <aris@ruivo.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: linux-edac@vger.kernel.org

--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -1597,6 +1597,7 @@ static unsigned long check_interval = INITIAL_CHECK_INTERVAL;
 
 static DEFINE_PER_CPU(unsigned long, mce_next_interval); /* in jiffies */
 static DEFINE_PER_CPU(struct timer_list, mce_timer);
+static DEFINE_RAW_SPINLOCK(timer_fn_lock);
 
 static unsigned long mce_adjust_timer_default(unsigned long interval)
 {
@@ -1628,7 +1629,9 @@ static void mce_timer_fn(struct timer_list *t)
 	iv = __this_cpu_read(mce_next_interval);
 
 	if (mce_available(this_cpu_ptr(&cpu_info))) {
+		raw_spin_lock(&timer_fn_lock);
 		machine_check_poll(0, this_cpu_ptr(&mce_poll_banks));
+		raw_spin_unlock(&timer_fn_lock);
 
 		if (mce_intel_cmci_poll()) {
 			iv = mce_adjust_timer(iv);

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-05-12 19:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-16 20:01 [RFC PATCH] mce: prevent concurrent polling of MCE events Aristeu Rozanski
2023-01-17 17:42 ` Luck, Tony
2023-01-17 18:44   ` Aristeu Rozanski
2023-01-17 18:54     ` Luck, Tony
2023-01-17 18:58       ` Aristeu Rozanski
2023-04-28 15:51   ` Aristeu Rozanski
2023-04-28 16:43     ` Luck, Tony
2023-05-11 23:38       ` Tony Luck
2023-05-12 17:32         ` Aristeu Rozanski
2023-05-12 19:19           ` Luck, Tony

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox