From: Oleg Nesterov Date: Wed, 30 Apr 2008 07:52:38 +0000 (-0700) Subject: k_getrusage: don't take rcu_read_lock() X-Git-Tag: v2.6.26-rc1~308 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d6cf723a142f63ccb92272bc0e9bfffd3c3a5cac;p=linux-2.6-omap-h63xx.git k_getrusage: don't take rcu_read_lock() Just a trivial example, more to come. k_getrusage() holds rcu_read_lock() because it was previously required by lock_task_sighand(). Unneeded now. Signed-off-by: Oleg Nesterov Cc: "Eric W. Biederman" Cc: "Paul E. McKenney" Cc: Roland McGrath Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sys.c b/kernel/sys.c index e423d0d9e6f..47c30a20b55 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1572,11 +1572,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) goto out; } - rcu_read_lock(); - if (!lock_task_sighand(p, &flags)) { - rcu_read_unlock(); + if (!lock_task_sighand(p, &flags)) return; - } switch (who) { case RUSAGE_BOTH: @@ -1612,9 +1609,7 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) default: BUG(); } - unlock_task_sighand(p, &flags); - rcu_read_unlock(); out: cputime_to_timeval(utime, &r->ru_utime);