Re: [RFC PATCH v3 3/8] mm/gup: split follow_page_pte_commit() out of follow_page_pte()
Rik van Riel <[email protected]>
| Newsgroups | org.kvack.linux-mm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 2026-08-22 at 14:31 -0700, John Hubbard wrote: > > Its workaround is folio_set_checked(), which defers the real work to > ext4_writepages(). If ext4 can't do the preparation from inside the > dirty call, a driver can't either. > > So for a file-backed page there's nothing the driver can add. What's > missing is a way for the filesystem to be told before the device > writes, and to revoke the pin when it needs to, which is where the > lease proposals come in. None of that exists today. > > And yes, unpin_user_pages_dirty_lock() is in the same awkward mess. That still leaves the question on what to do with code paths that rely on get_user_pages(FOLL_WRITE) to set the dirty bit on pages, and then do not set the dirty bit themselves after they write the page. Would it be better to move the dirty bit setting till after the write (to the page) has happened, even if that code does not queue up a filesystem write? Does unpin_user_pages_dirty_lock() need to call Folio_set_checked() ? You've made it pretty clear what is wrong, but I'm confused as to how we could improve the situation, at least without waiting for extensive filesystem changes first. -- All Rights Reversed.