linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] When migrate_pages returns 0, all pages must have been released
@ 2011-01-20 16:17 Minchan Kim
  2011-01-20 16:17 ` [PATCH 2/3] migration: Fix page corruption during hugepage migration Minchan Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Minchan Kim @ 2011-01-20 16:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, LKML, Mel Gorman, Andrea Arcangeli

From: Andrea Arcangeli <aarcange@redhat.com>

From: Andrea Arcangeli <aarcange@redhat.com>

In some cases migrate_pages could return zero while still leaving a
few pages in the pagelist (and some caller wouldn't notice it has to
call putback_lru_pages after commit
cf608ac19c95804dc2df43b1f4f9e068aa9034ab).

Add one missing putback_lru_pages not added by commit
cf608ac19c95804dc2df43b1f4f9e068aa9034ab.

Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---
 mm/memory-failure.c |    1 +
 mm/migrate.c        |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 548fbd7..75398b0 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1419,6 +1419,7 @@ int soft_offline_page(struct page *page, int flags)
 		ret = migrate_pages(&pagelist, new_page, MPOL_MF_MOVE_ALL,
 								0, true);
 		if (ret) {
+			putback_lru_pages(&pagelist);
 			pr_info("soft offline: %#lx: migration failed %d, type %lx\n",
 				pfn, ret, page->flags);
 			if (ret > 0)
diff --git a/mm/migrate.c b/mm/migrate.c
index 46fe8cc..7d34237 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -772,6 +772,7 @@ uncharge:
 unlock:
 	unlock_page(page);
 
+move_newpage:
 	if (rc != -EAGAIN) {
  		/*
  		 * A page that has been migrated has all references
@@ -785,8 +786,6 @@ unlock:
 		putback_lru_page(page);
 	}
 
-move_newpage:
-
 	/*
 	 * Move the new page to the LRU. If migration was not successful
 	 * then this will free the page.
-- 
1.7.0.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2011-01-26 23:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-20 16:17 [PATCH 1/3] When migrate_pages returns 0, all pages must have been released Minchan Kim
2011-01-20 16:17 ` [PATCH 2/3] migration: Fix page corruption during hugepage migration Minchan Kim
2011-01-20 16:17 ` [PATCH 3/3] compaction: Check migrate_pages's return value instead of list_empty Minchan Kim
2011-01-26  8:18   ` Mel Gorman
2011-01-20 17:30 ` [PATCH 1/3] When migrate_pages returns 0, all pages must have been released Christoph Lameter
2011-01-20 18:24   ` Andrea Arcangeli
2011-01-20 18:49     ` Christoph Lameter
2011-01-20 21:28       ` Andrea Arcangeli
2011-01-21 16:11         ` Christoph Lameter
2011-01-21 17:36           ` Andrea Arcangeli
2011-01-21 23:54             ` Minchan Kim
2011-01-26  8:14 ` Mel Gorman
2011-01-26 23:06 ` Andrew Morton
2011-01-26 23:21   ` Minchan Kim

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).