From 9e71691a19ef205794a723f645d44b2226416240 Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Tue, 27 Nov 2012 14:03:05 +0000 Subject: [PATCH] --- yaml --- r: 344791 b: refs/heads/master c: 149c33e1c98f83050870514f380902dc6d617bd5 h: refs/heads/master i: 344789: 301bc250b52a3755650dc54a1c11ea5f1ff0a7af 344787: a77259b0b81a42c1088bbacce74c4a6587d4272e 344783: 409cb0f14de7f44756da532e1d7d870f155dbd63 v: v3 --- [refs] | 2 +- trunk/mm/migrate.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 8464cba45ef0..0b8a2e509ef5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7039e1dbec6eeaa8ecab43a82d6589eeced995c3 +refs/heads/master: 149c33e1c98f83050870514f380902dc6d617bd5 diff --git a/trunk/mm/migrate.c b/trunk/mm/migrate.c index d168aec98427..c7d550011a64 100644 --- a/trunk/mm/migrate.c +++ b/trunk/mm/migrate.c @@ -1489,18 +1489,21 @@ int migrate_misplaced_page(struct page *page, int node) } isolated = 1; - /* - * Page is isolated which takes a reference count so now the - * callers reference can be safely dropped without the page - * disappearing underneath us during migration - */ - put_page(page); - page_lru = page_is_file_cache(page); inc_zone_page_state(page, NR_ISOLATED_ANON + page_lru); list_add(&page->lru, &migratepages); } + /* + * Page is either isolated or there is not enough space on the target + * node. If isolated, then it has taken a reference count and the + * callers reference can be safely dropped without the page + * disappearing underneath us during migration. Otherwise the page is + * not to be migrated but the callers reference should still be + * dropped so it does not leak. + */ + put_page(page); + if (isolated) { int nr_remaining;