https://bugzilla.kernel.org/show_bug.cgi?id=201631 --- Comment #21 from Jan Kara (jack@xxxxxxx) --- (In reply to Benjamin Herrenschmidt from comment #20) > Pardon my ignorance here, but I was under the impression that this was > normal :) The whole point being that the PTE dirty bit gets set when > accesses happen, and latter on gets harvested into the struct page dirty bit. > > Otherwise, what would be the point of having a PTE dirty bit in the PTE at > all or transferring a dirty bit from PTE to struct page in > try_to_unmap_one() (for example) if a writable page is always mapped dirty ? The PTE dirty bit is used for anonymous pages as you describe. File pages are marked dirty immediately during page fault (look for example at mm/memory.c:wp_page_shared() and its call to fault_dirty_shared_page()). When page gets written back, clear_page_dirty_for_io() is used which writeprotects all PTEs, clears PTE dirty bits, and then page dirty bit is cleared as well. So for shared file mappings PTE dirty bits could be ignored. The reason why PTE dirty bits are not ignored are partly heritage from before 2006 when this mechanism was introduced and party because people do it "just to be sure"... -- You are receiving this mail because: You are watching the assignee of the bug.