afs: Partially revert and use filemap_get_folio_tag()
Partially revert the changes made by:
acc8d8588cb7e3e64b0d2fa611dad06574cd67b1.
afs: convert afs_writepages_region() to use filemap_get_folios_tag()
The issue is that filemap_get_folios_tag() gets a batch of pages at a time,
and then afs_writepages_region() goes through them one at a time, extends
each into an operation with as many pages as will fit using the loop in
afs_extend_writeback() and submits it - but, in the common case, this means
that the other pages in the batch already got annexed and processed in
afs_extend_writeback() and we end up doing duplicate processing.
Switching to write_cache_pages() isn't an immediate substitute as that
doesn't take account of PG_fscache (and this bit is used in other ways by
other filesystems).
So go back to finding the next folio from the VM one at a time and then
extending the op onwards.
Fixes: acc8d8588cb7 ("afs: convert afs_writepages_region() to use filemap_get_folios_tag()")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Linus Torvalds <torvalds@linux-foundation.org>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Steve French <sfrench@samba.org>
cc: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
cc: Andrew Morton <akpm@linux-foundation.org>
cc: linux-afs@lists.infradead.org
cc: linux-mm@kvack.org
Link: https://lore.kernel.org/r/2214157.1677250083@warthog.procyon.org.uk/
1 file changed