Commit efdb672
mm/rmap: fix munlocking Anon THP with mlocked ptes
Many thanks to Kirill for reminding that PageDoubleMap cannot be relied on
to warn of pte mappings in the Anon THP case; and a scan of subpages does
not seem appropriate here. Note how follow_trans_huge_pmd() does not even
mark an Anon THP as mlocked when compound_mapcount != 1: multiple mlocking
of Anon THP is avoided, so simply return from page_mlock() in this case.
Link: https://lore.kernel.org/lkml/[email protected]/
Fixes: d9770fc ("mm/rmap: fix old bug: munlocking THP missed other mlocks")
Reported-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Acked-by: Kirill A. Shutemov <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Alistair Popple <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Ralph Campbell <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Shakeel Butt <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>1 parent e73f0f0 commit efdb672
1 file changed
+22
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1458 | 1457 | | |
1459 | 1458 | | |
1460 | 1459 | | |
| |||
1986 | 1985 | | |
1987 | 1986 | | |
1988 | 1987 | | |
1989 | | - | |
1990 | | - | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
1991 | 1992 | | |
1992 | 1993 | | |
1993 | 1994 | | |
| |||
2022 | 2023 | | |
2023 | 2024 | | |
2024 | 2025 | | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
2025 | 2030 | | |
2026 | 2031 | | |
2027 | 2032 | | |
| |||
0 commit comments