getrusage: use __for_each_thread()
authorOleg Nesterov <oleg@redhat.com>
Sat, 9 Sep 2023 17:26:29 +0000 (19:26 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 4 Oct 2023 17:41:57 +0000 (10:41 -0700)
commit13b7bc60b5353371460a203df6c38ccd38ad7a3a
tree7205d8460af43009851b1087d15da6e7dd874b10
parentc7ac8231ace9b07306d0299969e42073b189c70a
getrusage: use __for_each_thread()

do/while_each_thread should be avoided when possible.

Plus this change allows to avoid lock_task_sighand(), we can use rcu
and/or sig->stats_lock instead.

Link: https://lkml.kernel.org/r/20230909172629.GA20454@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/sys.c