From: Eric W. Biederman We don't need the tasklist_lock to safely iterate through processes anymore. This depends on my previous to task patches that make get_task_struct rcu safe, and that make next_task() rcu safe. I haven't gotten first_tid/next_tid yet only because next_thread is missing an rcu_dereference. Signed-off-by: Eric W. Biederman Signed-off-by: Andrew Morton --- fs/proc/base.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff -puN fs/proc/base.c~proc-remove-tasklist_lock-from-proc_pid_readdir fs/proc/base.c --- devel/fs/proc/base.c~proc-remove-tasklist_lock-from-proc_pid_readdir 2006-06-09 15:18:14.000000000 -0700 +++ devel-akpm/fs/proc/base.c 2006-06-09 15:18:14.000000000 -0700 @@ -2037,7 +2037,7 @@ out: static struct task_struct *first_tgid(int tgid, int nr) { struct task_struct *pos = NULL; - read_lock(&tasklist_lock); + rcu_read_lock(); if (tgid && nr) { pos = find_task_by_pid(tgid); if (pos && !thread_group_leader(pos)) @@ -2063,7 +2063,7 @@ static struct task_struct *first_tgid(in } pos = NULL; done: - read_unlock(&tasklist_lock); + rcu_read_unlock(); return pos; } @@ -2076,7 +2076,7 @@ done: static struct task_struct *next_tgid(struct task_struct *start) { struct task_struct *pos; - read_lock(&tasklist_lock); + rcu_read_lock(); pos = start; if (pid_alive(start)) pos = next_task(start); @@ -2086,7 +2086,7 @@ static struct task_struct *next_tgid(str } pos = NULL; done: - read_unlock(&tasklist_lock); + rcu_read_unlock(); put_task_struct(start); return pos; } _