Translated message

A translation of this page exists in English.

MCE 機能を無効にする方法

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux

Issue

  • MCE 機能を無効にするにはどうすればいいですか?
  • mcelogd サービスをオフにしても、/var/log/mcelog ファイルにコンテンツが残っているのはなぜですか?

Resolution

  • /boot/grub/grub.cfg に次の項目を追加します。
mce=off
  • kernel-doc パッケージから: Documentation/x86/x86_64/boot-options.txt
Machine check

   Please see Documentation/x86/x86_64/machinecheck for sysfs runtime tunables.

   mce=off
        Disable machine check
   mce=no_cmci
        Disable CMCI(Corrected Machine Check Interrupt) that
        Intel processor supports.  Usually this disablement is
        not recommended, but it might be handy if your hardware
        is misbehaving.
        Note that you'll get more problems without CMCI than with
        due to the shared banks, i.e. you might get duplicated
        error logs.
   mce=dont_log_ce
        Don't make logs for corrected errors.  All events reported
        as corrected are silently cleared by OS.
        This option will be useful if you have no interest in any
        of corrected errors.
   mce=ignore_ce
        Disable features for corrected errors, e.g. polling timer
        and CMCI.  All events reported as corrected are not cleared
        by OS and remained in its error banks.
        Usually this disablement is not recommended, however if
        there is an agent checking/clearing corrected errors
        (e.g. BIOS or hardware monitoring applications), conflicting
        with OS's error handling, and you cannot deactivate the agent,
        then this option will be a help.
   mce=bootlog
        Enable logging of machine checks left over from booting.
        Disabled by default on AMD because some BIOS leave bogus ones.
        If your BIOS doesn't do that it's a good idea to enable though
        to make sure you log even machine check events that result
        in a reboot. On Intel systems it is enabled by default.
   mce=nobootlog
        Disable boot machine check logging.
   mce=tolerancelevel[,monarchtimeout] (number,number)
        tolerance levels:
        0: always panic on uncorrected errors, log corrected errors
        1: panic or SIGBUS on uncorrected errors, log corrected errors
        2: SIGBUS or log uncorrected errors, log corrected errors
        3: never panic or SIGBUS, log all errors (for testing only)
        Default is 1
        Can be also set using sysfs which is preferable.
        monarchtimeout:
        Sets the time in us to wait for other CPUs on machine checks. 0
        to disable.

   nomce (for compatibility with i386): same as mce=off

   Everything else is in sysfs now.

Root Cause

  • RHEL6 では、cron ジョブによって/var/log/mcelog に mcelog が再生成されるため、mcelogd サービスを停止するだけでは不十分です。
    カーネルパラメーター行に mce=off を追加すると、/usr/sbin/mcelog コマンドは実行できなくなります。
$ cat /etc/cron.hourly/mcelog.cron 
#!/bin/bash
/usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog   
  • systemd サービスは RHEL7/8 で mcelog を保存します。
$ cat /etc/cron.hourly/mcelog.cron 
#!/bin/bash
# Disabled by default on Fedora since this is run as daemon
# using the mcelog.service systemd configuration entries.
#/usr/sbin/mcelog --ignorenodev --filter >> /var/log/mcelog

# systemctl status mcelog
● mcelog.service - Machine Check Exception Logging Daemon
   Loaded: loaded (/usr/lib/systemd/system/mcelog.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2019-11-05 18:52:38 EST; 2 weeks 6 days ago
 Main PID: 1174 (mcelog)
    Tasks: 1
   CGroup: /system.slice/mcelog.service
           └─1174 /usr/sbin/mcelog --ignorenodev --daemon --syslog

Nov 05 18:52:38 testjay systemd[1]: Starting Machine Check Exception Logging Daemon...
Nov 05 18:52:38 testjay systemd[1]: Started Machine Check Exception Logging Daemon.

Diagnostic Steps

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments