aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2011-01-13 18:46:14 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 20:32:36 -0500
commit1e50df39f6e2c3a4a3394df62baa8a213df16c54 (patch)
treed437981aec4fc5cf84178f7afcca83f0ef40aea1 /mm/mempolicy.c
parent53a7706d5ed8f1a53ba062b318773160cc476dde (diff)
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 <kosaki.motohiro@jp.fujitsu.com> Reported-by: Peter Zijlstra <peterz@infradead.org> Cc: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r--mm/mempolicy.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 7ee55af8d79c..e6d351265aed 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1310,16 +1310,13 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode,
1310 1310
1311 /* Find the mm_struct */ 1311 /* Find the mm_struct */
1312 rcu_read_lock(); 1312 rcu_read_lock();
1313 read_lock(&tasklist_lock);
1314 task = pid ? find_task_by_vpid(pid) : current; 1313 task = pid ? find_task_by_vpid(pid) : current;
1315 if (!task) { 1314 if (!task) {
1316 read_unlock(&tasklist_lock);
1317 rcu_read_unlock(); 1315 rcu_read_unlock();
1318 err = -ESRCH; 1316 err = -ESRCH;
1319 goto out; 1317 goto out;
1320 } 1318 }
1321 mm = get_task_mm(task); 1319 mm = get_task_mm(task);
1322 read_unlock(&tasklist_lock);
1323 rcu_read_unlock(); 1320 rcu_read_unlock();
1324 1321
1325 err = -EINVAL; 1322 err = -EINVAL;