On 1/27/22 01:02, Chris Mason wrote:
From the btrfs side, bare calls to set_page_dirty() are suboptimal,
since it doesn’t go through the ->page_mkwrite() dance that we use to
properly COW things. It’s still much better than SetPageDirty(), but
I’d love to understand why kvm needs to dirty the page so we can
figure out how to go through the normal mmap file io paths.
Shouldn't ->page_mkwrite() occur at the point of get_user_pages, such as
via handle_mm_fault->handle_pte_fault->do_fault->do_shared_fault? That
always happens before SetPageDirty(), or set_page_dirty() after Boris's
patch.
Thanks,
Paolo