diff options
author | Oleg Nesterov <oleg@redhat.com> | 2024-01-23 18:33:57 +0300 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-02-08 08:20:33 +0300 |
commit | 7601df8031fd67310af891897ef6cc0df4209305 (patch) | |
tree | ede6b84c438d11b00d632086a15ca3900c98671e /kernel | |
parent | 60f92acb60a989b14e4b744501a0df0f82ef30a3 (diff) | |
download | linux-7601df8031fd67310af891897ef6cc0df4209305.tar.xz |
fs/proc: do_task_stat: use sig->stats_lock to gather the threads/children stats
lock_task_sighand() can trigger a hard lockup. If NR_CPUS threads call
do_task_stat() at the same time and the process has NR_THREADS, it will
spin with irqs disabled O(NR_CPUS * NR_THREADS) time.
Change do_task_stat() to use sig->stats_lock to gather the statistics
outside of ->siglock protected section, in the likely case this code will
run lockless.
Link: https://lkml.kernel.org/r/20240123153357.GA21857@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Dylan Hatch <dylanbhatch@google.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions