For mailing lists, please use plaintext rather than HTML emails, and don’t
top-post.
> Are these statements correct?
>
> 1) Reading from a memory location (mmaped) with uncorrectable AND unknown
> error (also called as latent error) results in a machine-check (which
> usually results in a SIGBUS , default action
> in /sys/devices/system/machinecheck/machinecheckN).
>
> 4) Writing, however, in all the above cases does not result in any error.
When a CPU load instruction gets an uncorrectable error (i.e., the hardware
cannot provide any data to complete that instruction), the CPU creates a
machine check exception. The machine check handler decides what to do next.
That thread is stuck and cannot proceed, so the handler must do something
like:
* if the instruction was part of the kernel's memcpy_mcsafe() function (which
is called by the read() system call), force the function to return an error
which results in read() returning an I/O error to its caller
* if the instruction was issued by application (e.g. that had used mmap()
to get direct access to persistent memory), send SIGBUS to the application.
Most applications will just exit (and create a core dump). Some applications
can process SIGBUS and proceed (e.g., like the kernel does with
memcpy_mcsafe()).
* if the instruction was issued by the kernel outside memcpy_mcsafe(), do a
panic crash of the kernel
Historically, "EP class" CPUs always crashed the kernel while "EX class"
CPUs could proceed. For persistent memory, tolerance is a key CPU
feature. This indicates the CPU does support proceeding:
/sys/devices/system/machinecheck/machinecheck*/tolerant:1
> 2) Reading from a memory location (mmaped) with known error
> (badblock list) also results in a SIGBUS.
The pmem driver consults the badblock list to avoid asking the CPU to
load from a bad address and triggering a machine check; it can directly
start the appropriate error handling.
> 3) Reading via file interface (read()) will result in IO error
> returned in "both" the above cases.
A non-tolerant CPU will crash the kernel before read() completes.
A tolerant CPU will complete read() with an error.
> 4) Writing, however, in all the above cases does not result in any error.
A write of less than the ECC granularity triggers a read-modify-write,
and the CPU might detect that the read failed first. This isn't an
immediate problem for the store instruction, but is an early hint that
there will be problems reading those other bytes in the future.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm