当 memtester 的输出显示内存错误时,我该怎么办?

当 memtester 的输出显示内存错误时,我该怎么办?

Memtester 输出了以下响应,

memtester version 4.3.0 (64-bit)
Copyright (C) 2001-2012 Charles Cazabon.
Licensed under the GNU General Public License version 2 (only).

pagesize is 4096
pagesizemask is 0xfffffffffffff000
want 10240MB (10737418240 bytes)
got  10240MB (10737418240 bytes), trying mlock ...locked.
Loop 1/1:
  Stuck Address       : testing   1FAILURE: possible bad address line at offset 0x12325b7a8.
Skipping to next test...
  Random Value        : ok
FAILURE: 0xa003776ad640ac0c != 0xe003776ad640ac0c at offset 0x7a4f2680.
  Compare XOR         : FAILURE: 0xe7139f89d94112c0 != 0x27139f89d94112c0 at offset 0x7a4f2680.
FAILURE: 0x4e53ee3a9704bdf5 != 0x4a53ee3a9704bdf5 at offset 0x950b4930.
  Compare SUB         : FAILURE: 0x96ecab120464e9c0 != 0xd6ecab120464e9c0 at offset 0x7a4f2680.
FAILURE: 0x7f67022cef637b99 != 0x2b67022cef637b99 at offset 0x950b4930.
FAILURE: 0x96c38c9f6e6dd229 != 0xd6c38c9f6e6dd229 at offset 0xe40d2b50.
  Compare MUL         : FAILURE: 0x00000001 != 0x00000002 at offset 0x69394a08.
FAILURE: 0x00000001 != 0x00000000 at offset 0x950b4930.
FAILURE: 0x400000000000001 != 0x00000001 at offset 0xea6b07a8.
FAILURE: 0x400000000000000 != 0x00000000 at offset 0xfb853610.
FAILURE: 0x00000000 != 0x800000000000000 at offset 0x12bf3ed10.
  Compare DIV         : FAILURE: 0x777fd9f1ddc6c1cd != 0x777fd9f1ddc6c1cf at offset 0x69394a08.
FAILURE: 0x777fd9f1ddc6c1cd != 0x7f7fd9f1ddc6c1cd at offset 0x12bf3ed10.
  Compare OR          : FAILURE: 0x367600d19dc6c040 != 0x367600d19dc6c042 at offset 0x69394a08.
FAILURE: 0x367600d19dc6c040 != 0x767600d19dc6c040 at offset 0x7a4f2680.
FAILURE: 0x367600d19dc6c040 != 0x3e7600d19dc6c040 at offset 0x12bf3ed10.
  Compare AND         :   Sequential Increment: ok
  Solid Bits          : testing   0FAILURE: 0x4000000000000000 != 0x00000000 at offset 0x12325b7a8.
  Block Sequential    : testing   0FAILURE: 0x400000000000000 != 0x00000000 at offset 0xfb853610.
  Checkerboard        : testing   1FAILURE: 0xaaaaaaaaaaaaaaaa != 0xeaaaaaaaaaaaaaaa at offset 0x7a4f2680.
  Bit Spread          : testing   1FAILURE: 0xdffffffffffffff5 != 0xfffffffffffffff5 at offset 0x102e353e8.
  Bit Flip            : testing   0FAILURE: 0x4000000000000001 != 0x00000001 at offset 0x12325b7a8.
  Walking Ones        : testing  40FAILURE: 0xdffffeffffffffff != 0xfffffeffffffffff at offset 0x102e353e8.
  Walking Zeroes      : testing   0FAILURE: 0x400000000000001 != 0x00000001 at offset 0xea6b07a8.
FAILURE: 0x400000000000001 != 0x00000001 at offset 0xfb853610.
  8-bit Writes        : -FAILURE: 0xfeefa0a577dfa825 != 0xdeefa0a577dfa825 at offset 0x4bd600e8.
  16-bit Writes       : -FAILURE: 0xf3dfa5fff79e950b != 0xf7dfa5fff79e950b at offset 0x2b04cca8.
FAILURE: 0x3ffb3fc56e7532c1 != 0x7ffb3fc56e7532c1 at offset 0xe40d2b50.

Done.

显然,这表明记忆力很差。是否可以在内核或虚拟机管理程序中将此内存标记为坏内存并继续使用它?还是放到13号文件里去买替换的?

答案1

除非你能够相当快地检测到错误,例如使用 ECC 内存或定期重新启动memtest,最好更换模块。您将面临无声数据损坏的风险。

您可以使用选项告诉内核通过保留内存来忽略内存memmap(请参阅内核文档详情):

memmap=nn[KMG]$ss[KMG]

[KNL,ACPI] 将特定内存标记为保留。要保留的内存区域是从ssss+nn

示例:从 0x18690000-0x1869ffff 中排除内存

memmap=64K$0x18690000

或者

memmap=0x10000$0x18690000

有些引导加载程序可能需要在“$”之前有一个转义字符,例如Grub2,否则“$”和后面的数字将被吃掉。

这里的困难部分是弄清楚要保留的地址范围;memtester为您提供来自其虚拟地址空间的地址,该地址与 所需的物理地址不匹配memmap

最简单的方法是用 启动memtest,你会看到类似这样的东西

4c494e5558726c7a bad mem addr 0x000000012f9eaa78 - 0x000000012f9eaa80 reserved
4c494e5558726c7a bad mem addr 0x00000001b86fe928 - 0x00000001b86fe930 reserved
0x000000012f9eaa80 - 0x00000001b86fe928 pattern 4c494e5558726c7a

然后内核将停用它检测到的不良范围。您可以继续使用 启动memtest,或使用保留的地址范围来构造memmap参数。

答案2

您可以使用坏内存修补。但我强烈建议更改模块。内存可能会变得更糟,并且静默数据损坏是一个非常严重的问题。特别是如果运行数据库或加密,这很快就会变得致命......

相关内容