linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm: swap: use folio_batch_reinit() in folio_batch_move_lru()
@ 2023-03-31  9:58 Qi Zheng
  2023-03-31  9:58 ` [PATCH 2/2] mm: mlock: use folios_put() in mlock_folio_batch() Qi Zheng
  2023-03-31 22:04 ` [PATCH 1/2] mm: swap: use folio_batch_reinit() in folio_batch_move_lru() Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: Qi Zheng @ 2023-03-31  9:58 UTC (permalink / raw)
  To: akpm, willy, lstoakes; +Cc: linux-mm, linux-kernel, Qi Zheng

In folio_batch_move_lru(), the folio_batch is not freshly
initialised, so it should call folio_batch_reinit() as
pagevec_lru_move_fn() did before.

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

diff --git a/mm/swap.c b/mm/swap.c
index 57cb01b042f6..423199ee8478 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -222,7 +222,7 @@ static void folio_batch_move_lru(struct folio_batch *fbatch, move_fn_t move_fn)
 	if (lruvec)
 		unlock_page_lruvec_irqrestore(lruvec, flags);
 	folios_put(fbatch->folios, folio_batch_count(fbatch));
-	folio_batch_init(fbatch);
+	folio_batch_reinit(fbatch);
 }
 
 static void folio_batch_add_and_move(struct folio_batch *fbatch,
-- 
2.20.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-04  7:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31  9:58 [PATCH 1/2] mm: swap: use folio_batch_reinit() in folio_batch_move_lru() Qi Zheng
2023-03-31  9:58 ` [PATCH 2/2] mm: mlock: use folios_put() in mlock_folio_batch() Qi Zheng
2023-03-31 22:04 ` [PATCH 1/2] mm: swap: use folio_batch_reinit() in folio_batch_move_lru() Andrew Morton
2023-04-02 13:36   ` Qi Zheng
2023-04-04  7:07     ` Qi Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox