Commit aaa2a97eb9c0e91d7abc66bf76811a9599fdb3ee
Committed by
Linus Torvalds
1 parent
d359b549bf
Exists in
master
and in
39 other branches
[PATCH] sys_get_robust_list(): don't take tasklist_lock
use rcu locks for find_task_by_pid(). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
kernel/futex.c
... | ... | @@ -1624,7 +1624,7 @@ |
1624 | 1624 | struct task_struct *p; |
1625 | 1625 | |
1626 | 1626 | ret = -ESRCH; |
1627 | - read_lock(&tasklist_lock); | |
1627 | + rcu_read_lock(); | |
1628 | 1628 | p = find_task_by_pid(pid); |
1629 | 1629 | if (!p) |
1630 | 1630 | goto err_unlock; |
... | ... | @@ -1633,7 +1633,7 @@ |
1633 | 1633 | !capable(CAP_SYS_PTRACE)) |
1634 | 1634 | goto err_unlock; |
1635 | 1635 | head = p->robust_list; |
1636 | - read_unlock(&tasklist_lock); | |
1636 | + rcu_read_unlock(); | |
1637 | 1637 | } |
1638 | 1638 | |
1639 | 1639 | if (put_user(sizeof(*head), len_ptr)) |
... | ... | @@ -1641,7 +1641,7 @@ |
1641 | 1641 | return put_user(head, head_ptr); |
1642 | 1642 | |
1643 | 1643 | err_unlock: |
1644 | - read_unlock(&tasklist_lock); | |
1644 | + rcu_read_unlock(); | |
1645 | 1645 | |
1646 | 1646 | return ret; |
1647 | 1647 | } |