[PATCH v2 0/2] x86/mm: support memory-failure on 32-bits with SPARSEMEM

Xie Yuanbin
2025-11-04T07:23:20Z

Memory bit flips are among the most common hardware errors in the server
and embedded fields, many hardware components have memory verification
mechanisms, for example ECC. When an error is detected, some hardware or
architectures report the information to software (OS/BIOS), for example,
the MCE (Machine Check Exception) on x86.

Common errors include CE (Correctable Errors) and UE (Uncorrectable
Errors). When the kernel receives memory error information, if it has the
memory-failure feature, it can better handle memory errors without reboot.
For example, kernel can attempt to offline the affected memory by
migrating it or killing the process. Therefore, this feature is widely
used in servers and embedded fields.

For historical versions, memory-failure cannot be enabled with x86_32 &&
SPARSEMEM because the number of page-flags are insufficient. However, this
issue has been resolved in the current version, and this patch will allow
SPARSEMEM and memory-failure to be enabled together on x86_32.

By the way, due to increased demand, DRAM prices have recently
skyrocketed, making memory-failure potentially even more valuable in the
coming years.

v1-v2: https://lore.kernel.org/20251103033536.52234-1-xieyuanbin1@huawei.com
- Describe the purpose of these patches in the cover letter.

- Correct the description of historical changes to page flags.

- Move the memory-failure traceing code from ras_event.h to
memory-failure.h

Xie Yuanbin (2):
x86/mm: support memory-failure on 32-bits with SPARSEMEM
mm/memory-failure: remove the selection of RAS

arch/x86/Kconfig | 3 -
include/ras/ras_event.h | 86 ------------------------
include/trace/events/memory-failure.h | 97 +++++++++++++++++++++++++++
mm/Kconfig | 1 -
mm/memory-failure.c | 5 +-
5 files changed, 101 insertions(+), 91 deletions(-)
create mode 100644 include/trace/events/memory-failure.h

--
2.51.0