aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory_hotplug.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index e4af144ee409..9260314a221e 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -705,24 +705,21 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn)
705 check this again here. */ 705 check this again here. */
706 if (page_count(page)) { 706 if (page_count(page)) {
707 not_managed++; 707 not_managed++;
708 ret = -EBUSY;
708 break; 709 break;
709 } 710 }
710 } 711 }
711 } 712 }
712 ret = -EBUSY; 713 if (!list_empty(&source)) {
713 if (not_managed) { 714 if (not_managed) {
714 if (!list_empty(&source)) 715 putback_lru_pages(&source);
716 goto out;
717 }
718 /* this function returns # of failed pages */
719 ret = migrate_pages(&source, hotremove_migrate_alloc, 0, 1);
720 if (ret)
715 putback_lru_pages(&source); 721 putback_lru_pages(&source);
716 goto out;
717 } 722 }
718 ret = 0;
719 if (list_empty(&source))
720 goto out;
721 /* this function returns # of failed pages */
722 ret = migrate_pages(&source, hotremove_migrate_alloc, 0, 1);
723 if (ret)
724 putback_lru_pages(&source);
725
726out: 723out:
727 return ret; 724 return ret;
728} 725}