On 4/24/26 04:49, Zi Yan wrote: > This check ensures the correctness of collapse read-only THPs for FSes > after READ_ONLY_THP_FOR_FS is enabled by default for all FSes supporting > PMD THP pagecache. > > READ_ONLY_THP_FOR_FS only supports read-only fd and uses mapping->nr_thps > and inode->i_writecount to prevent any write to read-only to-be-collapsed > folios. In upcoming commits, READ_ONLY_THP_FOR_FS will be removed and the > aforementioned mechanism will go away too. To ensure khugepaged functions > as expected after the changes, skip if any folio is dirty after > try_to_unmap(), since a dirty folio means this read-only folio > got some writes via mmap can happen between try_to_unmap() and > try_to_unmap_flush() via cached TLB entries and khugepaged does not support > writable pagecache folio collapse yet. > > Signed-off-by: Zi Yan <[email protected]> > ---
Acked-by: David Hildenbrand (Arm) <[email protected]> -- Cheers, David

