All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] sys_get_robust_list: don't take tasklist_lock
@ 2006-08-21 17:06 Oleg Nesterov
  0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2006-08-21 17:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Ingo Molnar, Thomas Gleixner, Steven Rostedt, linux-kernel

use rcu locks for find_task_by_pid().

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 2.6.18-rc4/kernel/futex.c~3_sgrl	2006-08-21 20:41:15.000000000 +0400
+++ 2.6.18-rc4/kernel/futex.c	2006-08-21 20:59:24.000000000 +0400
@@ -1682,7 +1682,7 @@ sys_get_robust_list(int pid, struct robu
 		struct task_struct *p;
 
 		ret = -ESRCH;
-		read_lock(&tasklist_lock);
+		rcu_read_lock();
 		p = find_task_by_pid(pid);
 		if (!p)
 			goto err_unlock;
@@ -1691,7 +1691,7 @@ sys_get_robust_list(int pid, struct robu
 				!capable(CAP_SYS_PTRACE))
 			goto err_unlock;
 		head = p->robust_list;
-		read_unlock(&tasklist_lock);
+		rcu_read_unlock();
 	}
 
 	if (put_user(sizeof(*head), len_ptr))
@@ -1699,7 +1699,7 @@ sys_get_robust_list(int pid, struct robu
 	return put_user(head, head_ptr);
 
 err_unlock:
-	read_unlock(&tasklist_lock);
+	rcu_read_unlock();
 
 	return ret;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-21 12:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-21 17:06 [PATCH 3/3] sys_get_robust_list: don't take tasklist_lock Oleg Nesterov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.