linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] mm/vmscan: check the return value of migrate_pages()
@ 2022-09-17  2:12 Li Zhong
  2022-09-17  4:15 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Li Zhong @ 2022-09-17  2:12 UTC (permalink / raw)
  To: linux-kernel, linux-mm; +Cc: akpm, Li Zhong

Check the return value of migrate_pages() to check error exeuction.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 mm/vmscan.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index b2b1431352dc..50aaaa9377e2 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1547,6 +1547,7 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
 {
 	int target_nid = next_demotion_node(pgdat->node_id);
 	unsigned int nr_succeeded;
+	int ret;
 
 	if (list_empty(demote_pages))
 		return 0;
@@ -1555,10 +1556,13 @@ static unsigned int demote_page_list(struct list_head *demote_pages,
 		return 0;
 
 	/* Demotion ignores all cpuset and mempolicy settings */
-	migrate_pages(demote_pages, alloc_demote_page, NULL,
+	ret = migrate_pages(demote_pages, alloc_demote_page, NULL,
 			    target_nid, MIGRATE_ASYNC, MR_DEMOTION,
 			    &nr_succeeded);
 
+	if (ret)
+		putback_movable_pages(&pagelist);
+
 	if (current_is_kswapd())
 		__count_vm_events(PGDEMOTE_KSWAPD, nr_succeeded);
 	else
-- 
2.25.1



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

end of thread, other threads:[~2022-09-21 10:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17  2:12 [PATCH v1] mm/vmscan: check the return value of migrate_pages() Li Zhong
2022-09-17  4:15 ` kernel test robot
2022-09-17  4:25 ` kernel test robot
2022-09-21 10:42 ` Baolin Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).