aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2012-11-27 09:03:05 -0500
committerMel Gorman <mgorman@suse.de>2012-12-11 09:42:42 -0500
commit149c33e1c98f83050870514f380902dc6d617bd5 (patch)
tree5aaf7433c2de5f3176880835013049ccfbe7af73 /mm
parent7039e1dbec6eeaa8ecab43a82d6589eeced995c3 (diff)
mm: migrate: Drop the misplaced pages reference count if the target node is full
If we have to avoid migrating to a node that is nearly full, put page and return zero. Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Mel Gorman <mgorman@suse.de>
Diffstat (limited to 'mm')
-rw-r--r--mm/migrate.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index d168aec98427..c7d550011a64 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1489,18 +1489,21 @@ int migrate_misplaced_page(struct page *page, int node)
1489 } 1489 }
1490 isolated = 1; 1490 isolated = 1;
1491 1491
1492 /*
1493 * Page is isolated which takes a reference count so now the
1494 * callers reference can be safely dropped without the page
1495 * disappearing underneath us during migration
1496 */
1497 put_page(page);
1498
1499 page_lru = page_is_file_cache(page); 1492 page_lru = page_is_file_cache(page);
1500 inc_zone_page_state(page, NR_ISOLATED_ANON + page_lru); 1493 inc_zone_page_state(page, NR_ISOLATED_ANON + page_lru);
1501 list_add(&page->lru, &migratepages); 1494 list_add(&page->lru, &migratepages);
1502 } 1495 }
1503 1496
1497 /*
1498 * Page is either isolated or there is not enough space on the target
1499 * node. If isolated, then it has taken a reference count and the
1500 * callers reference can be safely dropped without the page
1501 * disappearing underneath us during migration. Otherwise the page is
1502 * not to be migrated but the callers reference should still be
1503 * dropped so it does not leak.
1504 */
1505 put_page(page);
1506
1504 if (isolated) { 1507 if (isolated) {
1505 int nr_remaining; 1508 int nr_remaining;
1506 1509