diff mbox series

[RFC,04/14] mm: Use folios_put() in __folio_batch_release()

Message ID 20230825135918.4164671-5-willy@infradead.org (mailing list archive)
State New
Headers show
Series Rearrange batched folio freeing | expand

Commit Message

Matthew Wilcox Aug. 25, 2023, 1:59 p.m. UTC
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.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/swap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ryan Roberts Aug. 31, 2023, 2:41 p.m. UTC | #1
On 25/08/2023 14:59, Matthew Wilcox (Oracle) wrote:
> 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.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>

> ---
>  mm/swap.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/swap.c b/mm/swap.c
> index 7bdc63b56859..c5ea0c6669e7 100644
> --- a/mm/swap.c
> +++ b/mm/swap.c
> @@ -1073,8 +1073,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);
>
diff mbox series

Patch

diff --git a/mm/swap.c b/mm/swap.c
index 7bdc63b56859..c5ea0c6669e7 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -1073,8 +1073,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);