From 57ee5d3dc3e3ccecba6d17f88e0192717ee7d203 Mon Sep 17 00:00:00 2001 From: Bob Liu Date: Tue, 26 Oct 2010 14:22:10 -0700 Subject: [PATCH] --- yaml --- r: 217497 b: refs/heads/master c: f3ab2636c5c1dd9ab0ff53a46d8354d5769ffdd4 h: refs/heads/master i: 217495: f947b61caed58424ed1a16c5b9d5bef86963be83 v: v3 --- [refs] | 2 +- trunk/mm/memory_hotplug.c | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 5984134de543..25320559b151 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 809c444977adb7313e0612e9e3af4b73ba3f5746 +refs/heads/master: f3ab2636c5c1dd9ab0ff53a46d8354d5769ffdd4 diff --git a/trunk/mm/memory_hotplug.c b/trunk/mm/memory_hotplug.c index e4af144ee409..9260314a221e 100644 --- a/trunk/mm/memory_hotplug.c +++ b/trunk/mm/memory_hotplug.c @@ -705,24 +705,21 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) check this again here. */ if (page_count(page)) { not_managed++; + ret = -EBUSY; break; } } } - ret = -EBUSY; - if (not_managed) { - if (!list_empty(&source)) + if (!list_empty(&source)) { + if (not_managed) { + putback_lru_pages(&source); + goto out; + } + /* this function returns # of failed pages */ + ret = migrate_pages(&source, hotremove_migrate_alloc, 0, 1); + if (ret) putback_lru_pages(&source); - goto out; } - ret = 0; - if (list_empty(&source)) - goto out; - /* this function returns # of failed pages */ - ret = migrate_pages(&source, hotremove_migrate_alloc, 0, 1); - if (ret) - putback_lru_pages(&source); - out: return ret; }