diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2011-01-13 18:46:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 20:32:36 -0500 |
commit | 1e50df39f6e2c3a4a3394df62baa8a213df16c54 (patch) | |
tree | d437981aec4fc5cf84178f7afcca83f0ef40aea1 /mm | |
parent | 53a7706d5ed8f1a53ba062b318773160cc476dde (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')
-rw-r--r-- | mm/mempolicy.c | 3 |
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; |