mm: use folios_put() in __folio_batch_release()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 27 Feb 2024 17:42:38 +0000 (17:42 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 5 Mar 2024 01:01:23 +0000 (17:01 -0800)
There's no need to indirect through release_pages() and iterate over this
batch of folios an extra time; we can just use the batch that we have.

Link: https://lkml.kernel.org/r/20240227174254.710559-5-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Mel Gorman <mgorman@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/swap.c

index 3d51f8c720171e0ee0d108b7090d59a79f04f581..1cfb7b897ebd1849fef4f6e22c8ec785910b1023 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -1083,8 +1083,7 @@ void __folio_batch_release(struct folio_batch *fbatch)
                lru_add_drain();
                fbatch->percpu_pvec_drained = true;
        }
-       release_pages(fbatch->folios, folio_batch_count(fbatch));
-       folio_batch_reinit(fbatch);
+       folios_put(fbatch);
 }
 EXPORT_SYMBOL(__folio_batch_release);