diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-06-26 00:25:51 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 09:58:25 -0700 |
commit | 454cc105ef690f2a0ba7c6b194d55666b4e918ce (patch) | |
tree | b3e4fef90f42ddd16afc324fcff6371e44f63255 | |
parent | 0bc58a910220be3446eedc8e77fd45c0a16d8f25 (diff) | |
download | op-kernel-dev-454cc105ef690f2a0ba7c6b194d55666b4e918ce.zip op-kernel-dev-454cc105ef690f2a0ba7c6b194d55666b4e918ce.tar.gz |
[PATCH] proc: Remove tasklist_lock from proc_pid_readdir
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 <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/proc/base.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 2236f7d..cc578a3 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2043,7 +2043,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)) @@ -2069,7 +2069,7 @@ static struct task_struct *first_tgid(int tgid, int nr) } pos = NULL; done: - read_unlock(&tasklist_lock); + rcu_read_unlock(); return pos; } @@ -2082,7 +2082,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); @@ -2092,7 +2092,7 @@ static struct task_struct *next_tgid(struct task_struct *start) } pos = NULL; done: - read_unlock(&tasklist_lock); + rcu_read_unlock(); put_task_struct(start); return pos; } |