Commit 6b97059
mm: hwpoison: support recovery from ksm_might_need_to_copy()
When the kernel copies a page from ksm_might_need_to_copy(), but runs into
an uncorrectable error, it will crash since poisoned page is consumed by
kernel, this is similar to the issue recently fixed by Copy-on-write
poison recovery.
When an error is detected during the page copy, return VM_FAULT_HWPOISON
in do_swap_page(), and install a hwpoison entry in unuse_pte() when
swapoff, which help us to avoid system crash. Note, memory failure on a
KSM page will be skipped, but still call memory_failure_queue() to be
consistent with general memory failure process, and we could support KSM
page recovery in the feature.
[[email protected]: enhance unuse_pte(), fix issue found by lkp]
Link: https://lkml.kernel.org/r/[email protected]
[[email protected]: update changelog, alter ksm_might_need_to_copy(), restore unlikely() in unuse_pte()]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Reviewed-by: Naoya Horiguchi <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Tony Luck <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 55d77ba commit 6b97059
3 files changed
+22
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2629 | 2629 | | |
2630 | 2630 | | |
2631 | 2631 | | |
2632 | | - | |
2633 | | - | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
2634 | 2637 | | |
2635 | 2638 | | |
2636 | 2639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3840 | 3840 | | |
3841 | 3841 | | |
3842 | 3842 | | |
| 3843 | + | |
| 3844 | + | |
| 3845 | + | |
3843 | 3846 | | |
3844 | 3847 | | |
3845 | 3848 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1764 | 1764 | | |
1765 | 1765 | | |
1766 | 1766 | | |
| 1767 | + | |
1767 | 1768 | | |
1768 | 1769 | | |
1769 | 1770 | | |
1770 | 1771 | | |
1771 | 1772 | | |
1772 | 1773 | | |
| 1774 | + | |
| 1775 | + | |
1773 | 1776 | | |
1774 | 1777 | | |
1775 | 1778 | | |
1776 | 1779 | | |
1777 | 1780 | | |
1778 | 1781 | | |
1779 | 1782 | | |
1780 | | - | |
1781 | | - | |
| 1783 | + | |
| 1784 | + | |
1782 | 1785 | | |
1783 | 1786 | | |
1784 | | - | |
1785 | | - | |
1786 | | - | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
1787 | 1794 | | |
1788 | | - | |
| 1795 | + | |
1789 | 1796 | | |
1790 | 1797 | | |
1791 | 1798 | | |
| |||
1817 | 1824 | | |
1818 | 1825 | | |
1819 | 1826 | | |
| 1827 | + | |
1820 | 1828 | | |
1821 | 1829 | | |
1822 | 1830 | | |
| |||
0 commit comments