From: KOSAKI Motohiro Date: Thu, 13 Jan 2011 23:46:14 +0000 (-0800) Subject: mempolicy: remove tasklist_lock from migrate_pages X-Git-Tag: 2.1b_release~5655 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e50df39f6e2c3a4a3394df62baa8a213df16c54;p=platform%2Fkernel%2Fkernel-mfld-blackbay.git 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: KOSAKI Motohiro Reported-by: Peter Zijlstra Cc: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 7ee55af..e6d3512 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -1310,16 +1310,13 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, /* Find the mm_struct */ rcu_read_lock(); - read_lock(&tasklist_lock); task = pid ? find_task_by_vpid(pid) : current; if (!task) { - read_unlock(&tasklist_lock); rcu_read_unlock(); err = -ESRCH; goto out; } mm = get_task_mm(task); - read_unlock(&tasklist_lock); rcu_read_unlock(); err = -EINVAL;