From 7cf8c16056f149ff54dc910499fccf524bee99fb Mon Sep 17 00:00:00 2001 From: Kuan-Ying Lee Date: Tue, 31 Jan 2023 14:32:06 +0800 Subject: [PATCH] mm/gup: add folio to list when folio_isolate_lru() succeed commit 643cf18a4ad126860d10e808ee5b52f785a27d61 upstream. If we call folio_isolate_lru() successfully, we will get return value 0. We need to add this folio to the movable_pages_list. Link: https://lkml.kernel.org/r/20230131063206.28820-1-Kuan-Ying.Lee@mediatek.com Fixes: db72948aa8b7 ("mm/gup.c: refactor check_and_migrate_movable_pages()") Signed-off-by: Kuan-Ying Lee Reviewed-by: Alistair Popple Acked-by: David Hildenbrand Reviewed-by: Baolin Wang Cc: Andrew Yang Cc: Chinwen Chang Cc: John Hubbard Cc: Matthias Brugger Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/gup.c b/mm/gup.c index eb8d7baf9e4d3..028f3b4e8c3f2 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1978,7 +1978,7 @@ static unsigned long collect_longterm_unpinnable_pages( drain_allow = false; } - if (!folio_isolate_lru(folio)) + if (folio_isolate_lru(folio)) continue; list_add_tail(&folio->lru, movable_page_list); -- 2.39.5