Commit d6cf723a authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

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: default avatarOleg 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1406f2d3
...@@ -1572,11 +1572,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) ...@@ -1572,11 +1572,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
goto out; goto out;
} }
rcu_read_lock(); if (!lock_task_sighand(p, &flags))
if (!lock_task_sighand(p, &flags)) {
rcu_read_unlock();
return; return;
}
switch (who) { switch (who) {
case RUSAGE_BOTH: case RUSAGE_BOTH:
...@@ -1612,9 +1609,7 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) ...@@ -1612,9 +1609,7 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
default: default:
BUG(); BUG();
} }
unlock_task_sighand(p, &flags); unlock_task_sighand(p, &flags);
rcu_read_unlock();
out: out:
cputime_to_timeval(utime, &r->ru_utime); cputime_to_timeval(utime, &r->ru_utime);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment