aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2013-09-11 17:22:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:57:47 -0400
commitb8ec1cee5a4375c1244b85709138a2eac2d89cb6 (patch)
treec3c548949ac53e1a66d891171d4b176f1d11538d /mm/migrate.c
parent31caf665e666b51fe36efd1e54031ed29e86c0b4 (diff)
mm: soft-offline: use migrate_pages() instead of migrate_huge_page()
Currently migrate_huge_page() takes a pointer to a hugepage to be migrated as an argument, instead of taking a pointer to the list of hugepages to be migrated. This behavior was introduced in commit 189ebff28 ("hugetlb: simplify migrate_huge_page()"), and was OK because until now hugepage migration is enabled only for soft-offlining which migrates only one hugepage in a single call. But the situation will change in the later patches in this series which enable other users of page migration to support hugepage migration. They can kick migration for both of normal pages and hugepages in a single call, so we need to go back to original implementation which uses linked lists to collect the hugepages to be migrated. With this patch, soft_offline_huge_page() switches to use migrate_pages(), and migrate_huge_page() is not used any more. So let's remove it. Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Acked-by: Andi Kleen <ak@linux.intel.com> Reviewed-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Acked-by: Hillf Danton <dhillf@gmail.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Hugh Dickins <hughd@google.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Michal Hocko <mhocko@suse.cz> Cc: Rik van Riel <riel@redhat.com> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index b44a067fee10..3ec47d3394c8 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -979,6 +979,8 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
979 979
980 unlock_page(hpage); 980 unlock_page(hpage);
981out: 981out:
982 if (rc != -EAGAIN)
983 putback_active_hugepage(hpage);
982 put_page(new_hpage); 984 put_page(new_hpage);
983 if (result) { 985 if (result) {
984 if (rc) 986 if (rc)
@@ -1066,32 +1068,6 @@ out:
1066 return rc; 1068 return rc;
1067} 1069}
1068 1070
1069int migrate_huge_page(struct page *hpage, new_page_t get_new_page,
1070 unsigned long private, enum migrate_mode mode)
1071{
1072 int pass, rc;
1073
1074 for (pass = 0; pass < 10; pass++) {
1075 rc = unmap_and_move_huge_page(get_new_page, private,
1076 hpage, pass > 2, mode);
1077 switch (rc) {
1078 case -ENOMEM:
1079 goto out;
1080 case -EAGAIN:
1081 /* try again */
1082 cond_resched();
1083 break;
1084 case MIGRATEPAGE_SUCCESS:
1085 goto out;
1086 default:
1087 rc = -EIO;
1088 goto out;
1089 }
1090 }
1091out:
1092 return rc;
1093}
1094
1095#ifdef CONFIG_NUMA 1071#ifdef CONFIG_NUMA
1096/* 1072/*
1097 * Move a list of individual pages 1073 * Move a list of individual pages