On Sat, Jul 05, 2025 at 07:32:58AM -0400, Jeff Layton wrote: > That is the fundamental question: should we delay writeback or not? It > seems like delaying it is probably best, even in the modern era with > SSDs, but we do need more numbers here (ideally across a range of > workloads). If you have asynchronous writeback there's probably no good reason to delay it per-se. But it does make sense to wait long enough to have a large I/O size, especially with some form of parity raid you'll want to fill up the chunk, but also storage devices themselves will perform much better with a larger size. e.g. for HDD you'll want to write 1MB batches, and similar write sizes also help with for SSDs. While the write performance itself might not be much worse with smaller I/O especially for high quality ones, large I/O helps to reduce the internal fragmentation and thus later reduces garbage collection overhead and thus increases life time. > > Ideally DONTCACHE should only affect cache usage and the latency of > > subsequence READs. It shouldn't affect WRITE behaviour. > > > > It definitely does affect it today. The ideal thing IMO would be to > just add the dropbehind flag to the folios on writes but not call > filemap_fdatawrite_range_kick() on every write operation. Yes, a mode that sets drop behind but leaves writeback to the writeback threads can be interesting. Right now it will still be bottlenecked by the single writeback thread, but work on this is underway.