mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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>
This commit is contained in:
parent
1406f2d321
commit
d6cf723a14
1 changed files with 1 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue