X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=mm%2Fmigrate.c;h=352de555626c4434471a53e29bee7a02516adfe3;hb=1eafbfeb7bdf59cfe173304c76188f3fd5f1fd05;hp=9f29a3b7aac2242c511b8a783226c247af301993;hpb=70d1f365568e0cdbc9f4ab92428e1830fdb09ab0;p=mv-sheeva.git diff --git a/mm/migrate.c b/mm/migrate.c index 9f29a3b7aac..352de555626 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -772,6 +772,7 @@ uncharge: unlock: unlock_page(page); +move_newpage: if (rc != -EAGAIN) { /* * A page that has been migrated has all references @@ -785,8 +786,6 @@ unlock: putback_lru_page(page); } -move_newpage: - /* * Move the new page to the LRU. If migration was not successful * then this will free the page. @@ -981,10 +980,6 @@ int migrate_huge_pages(struct list_head *from, } rc = 0; out: - - list_for_each_entry_safe(page, page2, from, lru) - put_page(page); - if (rc) return rc; @@ -1292,14 +1287,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, return -EPERM; /* Find the mm_struct */ - read_lock(&tasklist_lock); + rcu_read_lock(); task = pid ? find_task_by_vpid(pid) : current; if (!task) { - read_unlock(&tasklist_lock); + rcu_read_unlock(); return -ESRCH; } mm = get_task_mm(task); - read_unlock(&tasklist_lock); + rcu_read_unlock(); if (!mm) return -EINVAL;