[v2,2/2] mm: mlock: use folios_put() in mlock_folio_batch()

Message ID 20230405161854.6931-2-zhengqi.arch@bytedance.com
State New
Headers
Series [v2,1/2] mm: swap: fix performance regression on sparsetruncate-tiny |

Commit Message

Qi Zheng April 5, 2023, 4:18 p.m. UTC
  Since we have updated mlock to use folios, it's better
to call folios_put() instead of calling release_pages()
directly.

Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
---
 mm/mlock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Mel Gorman April 6, 2023, 10:26 a.m. UTC | #1
On Thu, Apr 06, 2023 at 12:18:54AM +0800, Qi Zheng wrote:
> Since we have updated mlock to use folios, it's better
> to call folios_put() instead of calling release_pages()
> directly.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Acked-by: Mel Gorman <mgorman@suse.de>
  

Patch

diff --git a/mm/mlock.c b/mm/mlock.c
index 617469fce96d..40b43f8740df 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -206,7 +206,7 @@  static void mlock_folio_batch(struct folio_batch *fbatch)
 
 	if (lruvec)
 		unlock_page_lruvec_irq(lruvec);
-	release_pages(fbatch->folios, fbatch->nr);
+	folios_put(fbatch->folios, folio_batch_count(fbatch));
 	folio_batch_reinit(fbatch);
 }