On Tue, Jan 04, 2022 at 06:08:24PM +0000, Matthew Wilcox wrote: > I think it's fine to put in a fix like this now that's readily > backportable. For folios, I can't help but think we want a > restructuring to iterate per-extent first, then per-folio and finally > per-sector instead of the current model where we iterate per folio, > looking up the extent for each sector. We don't look up the extent for each sector. We look up the extent once and then add as much of it as we can to the bio until either the bio is full or the extent ends. In the first case we then allocate a new bio and add it to the ioend. > Particularly for the kind of case Trond is talking about here; when we > want to fsync(), as long as the entire folio is Uptodate, we want to > write the entire thing back. Doing it in portions and merging them back > together seems like a lot of wasted effort. Writing everything together should be the common case.