Skip to contentSkip to conversation

sys_get_robust_list: don't take tasklist_lock

PATCH In review Oleg Nesterov 1 participant 1 message Aug 21, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 sys_get_robust_list: don't take tasklist_lock

use rcu locks for find_task_by_pid().

kernel/futex.c renamed from kernel/futex.c~3_sgrl +3 -3
@@ -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;
 }