On Mon, Aug 18, 2025 at 08:56:31AM -0700, Trond Myklebust wrote: > On Mon, 2025-08-18 at 16:21 +0100, Matthew Wilcox wrote: > > I don't think this technique is "safe". By clearing the flag early, > > the page cache can't see that a folio that was created by dropbehind > > has now been reused and should have its dropbehind flag cleared. So > > we > > might see pages dropped from the cache that really should not be. > > The only alternative would be to add back in a helper in mm/filemap.c > that does the normal folio_end_writeback() routine, but ignores the > dropbehind flag. (folio_end_writeback_ignore_dropbehind()?) Can you remind me why we clear the writeback flag as soon as the WRITE completes instead of leaving it set until the COMMIT completes?