Imagine:
- you have swap partition on a failing disk;
- a process is idle and part of its memory gets swapped into this partition;
- after some time it wakes up and kernel tries to load swapped pages back into the memory;
- kernel detects unrecoverable read error.
I believe kernel should crash the process in this scenario.
I haven't simulated it yet. I just want to know some answers (possibly with instructions how to simulate it in Linux) and share my subsequent findings as well.
Maybe this scenario can explain few crashes on some legacy systems with failing storage hardware.
UPDATE
Simulating errors on specific swap
volume can easily be done using dmsetup
with error
mapping target:
The only thing I didn't look in depth is how to control loading, swapping and re-loading virtual memory of specific process into specific error
-mapped part of swap
volume. Basically, I need to avoid any other processes using this erroneous swap
except the process under simulation.