From: Oleg Nesterov do_task_stat() has a huge list of the local variables, move "struct pid *pgrp" under "if (sig->tty)". Signed-off-by: Oleg Nesterov Cc: Alan Cox Signed-off-by: Andrew Morton --- fs/proc/array.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -puN fs/proc/array.c~tty_io-fix-remaining-pid-struct-locking-small-cleanup fs/proc/array.c --- a/fs/proc/array.c~tty_io-fix-remaining-pid-struct-locking-small-cleanup +++ a/fs/proc/array.c @@ -408,7 +408,6 @@ static int do_task_stat(struct seq_file unsigned long rsslim = 0; char tcomm[sizeof(task->comm)]; unsigned long flags; - struct pid *pgrp; state = *get_task_state(task); vsize = eip = esp = 0; @@ -430,7 +429,7 @@ static int do_task_stat(struct seq_file struct signal_struct *sig = task->signal; if (sig->tty) { - pgrp = tty_get_pgrp(sig->tty); + struct pid *pgrp = tty_get_pgrp(sig->tty); tty_pgrp = pid_nr_ns(pgrp, ns); put_pid(pgrp); tty_nr = new_encode_dev(tty_devnum(sig->tty)); _