Commit 1e50df39 authored by KOSAKI Motohiro's avatar KOSAKI Motohiro Committed by Linus Torvalds

mempolicy: remove tasklist_lock from migrate_pages

Today, tasklist_lock in migrate_pages doesn't protect anything.
rcu_read_lock() provide enough protection from pid hash walk.
Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reported-by: default avatarPeter Zijlstra <peterz@infradead.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 53a7706d
...@@ -1310,16 +1310,13 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, ...@@ -1310,16 +1310,13 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
/* Find the mm_struct */ /* Find the mm_struct */
rcu_read_lock(); rcu_read_lock();
read_lock(&tasklist_lock);
task = pid ? find_task_by_vpid(pid) : current; task = pid ? find_task_by_vpid(pid) : current;
if (!task) { if (!task) {
read_unlock(&tasklist_lock);
rcu_read_unlock(); rcu_read_unlock();
err = -ESRCH; err = -ESRCH;
goto out; goto out;
} }
mm = get_task_mm(task); mm = get_task_mm(task);
read_unlock(&tasklist_lock);
rcu_read_unlock(); rcu_read_unlock();
err = -EINVAL; err = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment