Skip to contentSkip to conversation

do_task_stat: don't take rcu_read_lock()

PATCH New Oleg Nesterov 1 participant 1 message Feb 20, 2008 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 do_task_stat: don't take rcu_read_lock()

(depends on "[PATCH 1/2] lock_task_sighand: add rcu lock/unlock",
http://marc.info/?l=linux-kernel&m=120335433821564)

lock_task_sighand() was changed, and do_task_stat() doesn't need rcu_read_lock any longer. sighand->siglock protects all "interesting" fields.

Except: it doesn't protect ->tty->pgrp, but neither does rcu_read_lock(), this should be fixed.

fs/proc/array.c renamed from fs/proc/array.c~DTS +0 -2
@@ -425,7 +425,6 @@ static int do_task_stat(struct seq_file 
 	cutime = cstime = utime = stime = cputime_zero;
 	cgtime = gtime = cputime_zero;
 
-	rcu_read_lock();
 	if (lock_task_sighand(task, &flags)) {
 		struct signal_struct *sig = task->signal;
 
@@ -469,7 +468,6 @@ static int do_task_stat(struct seq_file 
 
 		unlock_task_sighand(task, &flags);
 	}
-	rcu_read_unlock();
 
 	if (!whole || num_threads < 2)
 		wchan = get_wchan(task);