]> git.baikalelectronics.ru Git - kernel.git/commit
proc: Use task_is_running() for wchan in /proc/$pid/stat
authorKees Cook <keescook@chromium.org>
Wed, 29 Sep 2021 22:02:15 +0000 (15:02 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 15 Oct 2021 09:25:13 +0000 (11:25 +0200)
commit626a77b9cfdcaddb01eb1350543877d2125429eb
tree2b1c78b7f3069885e3ec36cf04e4724e8de21691
parent2a80a621c0e7b6258efc11766a05fd4c2ad5536b
proc: Use task_is_running() for wchan in /proc/$pid/stat

The implementations of get_wchan() can be expensive. The only information
imparted here is whether or not a process is currently blocked in the
scheduler (and even this doesn't need to be exact). Avoid doing the
heavy lifting of stack walking and just report that information by using
task_is_running().

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20211008111626.211281780@infradead.org
fs/proc/array.c