Fix a procfs task state reporting regression when freezing sleeping tasks.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmdxEyoRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1howA/8C8dsikI/S+GWRRnMStBuRyjlh602xJA4
 ehIjRiLm84Ue71hcRNwPwuW6rJrxDsMG1k1vBcDMhqsZrZt3ldvONpLWZod1sK9v
 wpiPBVsl+V5KR37fVkCa7bb2SDN8z46WjAbYG9bQCLWMv5QmrVa3tIVdPma0nz6I
 7H+UR5LfQyg9C2VqkYo2S/gosoLHg3MX9/ULJFkz6BLzHvfV0htTIlzJNYwBY0qU
 OG9KqMAFN5l0t12sx7IEPAnYlm0RJYcXeOfjiMwWj4sarRfOAFa8s1HuriSQsC7O
 Ypkd2Uj6jtpdoIgkBKvSKKohkxxL7zPZtotiBo7aeQf+Bt6yByQzveF77kYWtnLP
 dmRwZAYPnAMWiajUWukc3bXTVx9zIXER6+5/yWwcLLTVkM8PUxrKW5xmP+oXkMul
 Hp6Kp/Hf5lqjKC0kgHX8O7sZeBmsC1x9SiNM4xx0r+NvnQNdztqbzRFXwGaa5vnA
 fRDQhCFW1BgIapc4340X/HyrSfqNMJZtFwVHFe6B9VUQKfIAocrwAvd6HxVx0YKX
 5/YDddNI/+jzHmGhZHPPQ8GDVHTtzXuBhzBSISj3x6AgIjCiAKu2KtOdzL+YEMw/
 aM6Il/cg1gtijkwhgRcK7b0AJ+8yfFMfri/1tQjJNDnDUYN0mEJsaXqT/KKceDVQ
 DDxPkSIR7aI=
 =p+tV
 -----END PGP SIGNATURE-----

Merge tag 'sched-urgent-2024-12-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fix from Ingo Molnar:
 "Fix a procfs task state reporting regression when freezing sleeping
  tasks"

* tag 'sched-urgent-2024-12-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  freezer, sched: Report frozen tasks as 'D' instead of 'R'
This commit is contained in:
Linus Torvalds 2024-12-29 10:19:54 -08:00
commit 4099a71718

View File

@ -1637,8 +1637,9 @@ static inline unsigned int __task_state_index(unsigned int tsk_state,
* We're lying here, but rather than expose a completely new task state
* to userspace, we can make this appear as if the task has gone through
* a regular rt_mutex_lock() call.
* Report frozen tasks as uninterruptible.
*/
if (tsk_state & TASK_RTLOCK_WAIT)
if ((tsk_state & TASK_RTLOCK_WAIT) || (tsk_state & TASK_FROZEN))
state = TASK_UNINTERRUPTIBLE;
return fls(state);