summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-04-30 09:52:38 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 17:29:34 +0200
commitd6cf723a142f63ccb92272bc0e9bfffd3c3a5cac (patch)
tree16ec6665ebb03107d40f5ab0884ca7e8394b5358
parentlock_task_sighand: add rcu lock/unlock (diff)
downloadlinux-d6cf723a142f63ccb92272bc0e9bfffd3c3a5cac.tar.xz
linux-d6cf723a142f63ccb92272bc0e9bfffd3c3a5cac.zip
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 <oleg@tv-sign.ru> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/sys.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index e423d0d9e6ff..47c30a20b554 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);