diff options
| author | Oleg Nesterov <[email protected]> | 2006-12-08 02:36:07 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2006-12-08 08:28:38 -0800 |
| commit | 915935041281c64589e2b7fe38437be22567fb6f (patch) | |
| tree | fef15e8442be8ab8c72439ff916855444a8e95b8 /fs/proc/array.c | |
| parent | 24ec839c431eb79bb8f6abc00c4e1eb3b8c4d517 (diff) | |
[PATCH] do_task_stat(): don't take tty_mutex
->signal->tty is protected by ->siglock, no need to take the global tty_mutex.
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: Alan Cox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
| -rw-r--r-- | fs/proc/array.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c index 25e917fb4739..b0cd014a39bd 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -346,20 +346,13 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) sigemptyset(&sigcatch); cutime = cstime = utime = stime = cputime_zero; - mutex_lock(&tty_mutex); rcu_read_lock(); if (lock_task_sighand(task, &flags)) { struct signal_struct *sig = task->signal; - struct tty_struct *tty = sig->tty; - - if (tty) { - /* - * sig->tty is not stable, but tty_mutex - * protects us from release_dev(tty) - */ - barrier(); - tty_pgrp = tty->pgrp; - tty_nr = new_encode_dev(tty_devnum(tty)); + + if (sig->tty) { + tty_pgrp = sig->tty->pgrp; + tty_nr = new_encode_dev(tty_devnum(sig->tty)); } num_threads = atomic_read(&sig->count); @@ -395,7 +388,6 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole) unlock_task_sighand(task, &flags); } rcu_read_unlock(); - mutex_unlock(&tty_mutex); if (!whole || num_threads<2) wchan = get_wchan(task); |