Commit 8625147
hugetlbfs: don't delete error page from pagecache
This change is very similar to the change that was made for shmem [1], and
it solves the same problem but for HugeTLBFS instead.
Currently, when poison is found in a HugeTLB page, the page is removed
from the page cache. That means that attempting to map or read that
hugepage in the future will result in a new hugepage being allocated
instead of notifying the user that the page was poisoned. As [1] states,
this is effectively memory corruption.
The fix is to leave the page in the page cache. If the user attempts to
use a poisoned HugeTLB page with a syscall, the syscall will fail with
EIO, the same error code that shmem uses. For attempts to map the page,
the thread will get a BUS_MCEERR_AR SIGBUS.
[1]: commit a760542 ("mm: shmem: don't truncate page if memory failure happens")
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: James Houghton <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Reviewed-by: Naoya Horiguchi <[email protected]>
Tested-by: Naoya Horiguchi <[email protected]>
Reviewed-by: Yang Shi <[email protected]>
Cc: Axel Rasmussen <[email protected]>
Cc: James Houghton <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Muchun Song <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>1 parent 120b116 commit 8625147
3 files changed
+14
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
331 | 337 | | |
332 | 338 | | |
333 | 339 | | |
| |||
1111 | 1117 | | |
1112 | 1118 | | |
1113 | 1119 | | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | 1120 | | |
1122 | 1121 | | |
1123 | 1122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6111 | 6111 | | |
6112 | 6112 | | |
6113 | 6113 | | |
| 6114 | + | |
| 6115 | + | |
| 6116 | + | |
| 6117 | + | |
6114 | 6118 | | |
6115 | 6119 | | |
6116 | 6120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
| 1083 | + | |
1083 | 1084 | | |
1084 | 1085 | | |
1085 | 1086 | | |
1086 | 1087 | | |
1087 | 1088 | | |
1088 | 1089 | | |
1089 | 1090 | | |
| 1091 | + | |
| 1092 | + | |
1090 | 1093 | | |
1091 | 1094 | | |
1092 | 1095 | | |
| |||
1104 | 1107 | | |
1105 | 1108 | | |
1106 | 1109 | | |
1107 | | - | |
| 1110 | + | |
1108 | 1111 | | |
1109 | 1112 | | |
1110 | 1113 | | |
| |||
0 commit comments