Skip to content

Commit 3ccfcdc

Browse files
committed
Merge branch 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS fix from Thomas Gleixner: "Prevent dmesg from being spammed when MCE logging is active" * 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Don't print MCEs when mcelog is active
2 parents a71c9a1 + cc66afe commit 3ccfcdc

File tree

1 file changed

+6
-1
lines changed
  • arch/x86/kernel/cpu/mcheck

1 file changed

+6
-1
lines changed

arch/x86/kernel/cpu/mcheck/mce.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454

5555
static DEFINE_MUTEX(mce_chrdev_read_mutex);
5656

57+
static int mce_chrdev_open_count; /* #times opened */
58+
5759
#define mce_log_get_idx_check(p) \
5860
({ \
5961
RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \
@@ -598,6 +600,10 @@ static int mce_default_notifier(struct notifier_block *nb, unsigned long val,
598600
if (atomic_read(&num_notifiers) > 2)
599601
return NOTIFY_DONE;
600602

603+
/* Don't print when mcelog is running */
604+
if (mce_chrdev_open_count > 0)
605+
return NOTIFY_DONE;
606+
601607
__print_mce(m);
602608

603609
return NOTIFY_DONE;
@@ -1828,7 +1834,6 @@ void mcheck_cpu_clear(struct cpuinfo_x86 *c)
18281834
*/
18291835

18301836
static DEFINE_SPINLOCK(mce_chrdev_state_lock);
1831-
static int mce_chrdev_open_count; /* #times opened */
18321837
static int mce_chrdev_open_exclu; /* already open exclusive? */
18331838

18341839
static int mce_chrdev_open(struct inode *inode, struct file *file)

0 commit comments

Comments
 (0)