summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/python_version.py
diff options
context:
space:
mode:
authorChris Mason <mason@kernel.org>2026-10-31 10:39:46 +0100
committerDavid Hildenbrand (Arm) <david@kernel.org>2026-11-03 20:20:52 +0100
commitfe2817e3d5ea347214342c9a5cd8bcbff20c0574 (patch)
tree1366349eaacabc6a4252600e625a53316bb90ffa /tools/lib/python/kdoc/python_version.py
parentdb38b902307e687219ec765ef51a6ef459746c87 (diff)
mm/khugepaged: preserve dirty bits when collapsing PTE-mapped THPs
try_collapse_pte_mapped_thp() clears PTEs without transferring their dirty bits to the folio. A shmem read fault can map a clean folio writable, so a later store only dirties the PTE. Losing that dirty bit allows reclaim to discard modified data. The assumption that regular files are read-only is also obsolete since commit 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse for writable files"). In any case, transferring PTE dirty bits to the folio when removing mappings (and while the folio is still mapped) is the right thing to do. Use get_and_clear_ptes() to collect the dirty bits and mark the folio dirty before unmapping it. Update the comment. This was reproduced with shmem using MADV_COLLAPSE followed by MADV_PAGEOUT. Fix generated by an LLM and sent by Chris Mason in private. Fixes: 27e1f8273113 ("khugepaged: enable collapse pmd for pte-mapped THP") Fixes: 1b6444331bebb ("mm/khugepaged: enable clean pagecache folio collapse for writable files") Cc: stable@vger.kernel.org Signed-off-by: Chris Mason <mason@kernel.org> [ david: adjust comment; simplify description; cover file-thp as well ] Reviewed-by: Pedro Falcato <pfalcato@suse.de> Reviewed-by: Gregory Price (Meta) <gourry@gourry.net> Tested-by: Gregory Price (Meta) <gourry@gourry.net> Tested-by: Muhammad Usama Anjum <usama.anjum@arm.com> Link: https://patch.msgid.link/20261031-fixes_core-v3-17-d6437171ecc3@kernel.org Reviewed-by: Lance Yang <lance.yang@linux.dev> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions