Commit 9ed33c7
mm: fix finish_fault() handling for large folios
commit 34b82f3 upstream.
When handling faults for anon shmem finish_fault() will attempt to install
ptes for the entire folio. Unfortunately if it encounters a single
non-pte_none entry in that range it will bail, even if the pte that
triggered the fault is still pte_none. When this situation happens the
fault will be retried endlessly never making forward progress.
This patch fixes this behavior and if it detects that a pte in the range
is not pte_none it will fall back to setting a single pte.
[[email protected]: tweak whitespace]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: 43e027e ("mm: memory: extend finish_fault() to support large folio")
Signed-off-by: Brian Geffon <[email protected]>
Suggested-by: Baolin Wang <[email protected]>
Reported-by: Marek Maslanka <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: Hugh Dickens <[email protected]>
Cc: Kefeng Wang <[email protected]>
Cc: Matthew Wilcow (Oracle) <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Zi Yan <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 605f53f commit 9ed33c7
1 file changed
+10
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5079 | 5079 | | |
5080 | 5080 | | |
5081 | 5081 | | |
5082 | | - | |
| 5082 | + | |
| 5083 | + | |
| 5084 | + | |
| 5085 | + | |
| 5086 | + | |
5083 | 5087 | | |
5084 | 5088 | | |
5085 | 5089 | | |
| |||
5118 | 5122 | | |
5119 | 5123 | | |
5120 | 5124 | | |
5121 | | - | |
| 5125 | + | |
| 5126 | + | |
5122 | 5127 | | |
5123 | 5128 | | |
5124 | 5129 | | |
| |||
5154 | 5159 | | |
5155 | 5160 | | |
5156 | 5161 | | |
5157 | | - | |
5158 | | - | |
5159 | | - | |
| 5162 | + | |
| 5163 | + | |
| 5164 | + | |
5160 | 5165 | | |
5161 | 5166 | | |
5162 | 5167 | | |
| |||
0 commit comments