diff options
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index 46fe8cc13d67..352de555626c 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -772,6 +772,7 @@ uncharge: | |||
772 | unlock: | 772 | unlock: |
773 | unlock_page(page); | 773 | unlock_page(page); |
774 | 774 | ||
775 | move_newpage: | ||
775 | if (rc != -EAGAIN) { | 776 | if (rc != -EAGAIN) { |
776 | /* | 777 | /* |
777 | * A page that has been migrated has all references | 778 | * A page that has been migrated has all references |
@@ -785,8 +786,6 @@ unlock: | |||
785 | putback_lru_page(page); | 786 | putback_lru_page(page); |
786 | } | 787 | } |
787 | 788 | ||
788 | move_newpage: | ||
789 | |||
790 | /* | 789 | /* |
791 | * Move the new page to the LRU. If migration was not successful | 790 | * Move the new page to the LRU. If migration was not successful |
792 | * then this will free the page. | 791 | * then this will free the page. |
@@ -888,7 +887,7 @@ out: | |||
888 | * are movable anymore because to has become empty | 887 | * are movable anymore because to has become empty |
889 | * or no retryable pages exist anymore. | 888 | * or no retryable pages exist anymore. |
890 | * Caller should call putback_lru_pages to return pages to the LRU | 889 | * Caller should call putback_lru_pages to return pages to the LRU |
891 | * or free list. | 890 | * or free list only if ret != 0. |
892 | * | 891 | * |
893 | * Return: Number of pages not migrated or error code. | 892 | * Return: Number of pages not migrated or error code. |
894 | */ | 893 | */ |
@@ -981,10 +980,6 @@ int migrate_huge_pages(struct list_head *from, | |||
981 | } | 980 | } |
982 | rc = 0; | 981 | rc = 0; |
983 | out: | 982 | out: |
984 | |||
985 | list_for_each_entry_safe(page, page2, from, lru) | ||
986 | put_page(page); | ||
987 | |||
988 | if (rc) | 983 | if (rc) |
989 | return rc; | 984 | return rc; |
990 | 985 | ||
@@ -1292,14 +1287,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, | |||
1292 | return -EPERM; | 1287 | return -EPERM; |
1293 | 1288 | ||
1294 | /* Find the mm_struct */ | 1289 | /* Find the mm_struct */ |
1295 | read_lock(&tasklist_lock); | 1290 | rcu_read_lock(); |
1296 | task = pid ? find_task_by_vpid(pid) : current; | 1291 | task = pid ? find_task_by_vpid(pid) : current; |
1297 | if (!task) { | 1292 | if (!task) { |
1298 | read_unlock(&tasklist_lock); | 1293 | rcu_read_unlock(); |
1299 | return -ESRCH; | 1294 | return -ESRCH; |
1300 | } | 1295 | } |
1301 | mm = get_task_mm(task); | 1296 | mm = get_task_mm(task); |
1302 | read_unlock(&tasklist_lock); | 1297 | rcu_read_unlock(); |
1303 | 1298 | ||
1304 | if (!mm) | 1299 | if (!mm) |
1305 | return -EINVAL; | 1300 | return -EINVAL; |