]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE
authorNeilBrown <neilb@suse.de>
Tue, 29 Aug 2023 23:04:19 +0000 (09:04 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:30:54 +0000 (10:30 +0100)
commitb0ce4e8fedbd783b110693de311031d7ea04cdda
tree2cfc0bc7a6d7e29d2dbd15a277275c56da879e88
parentda719022a474bc6e9c8688c7c2084c04e58cd36f
sched/core: Report correct state for TASK_IDLE | TASK_FREEZABLE

[ Upstream commit 0d6b35283bcf1a379cf20066544af8e6a6b16b46 ]

task_state_index() ignores uninteresting state flags (such as
TASK_FREEZABLE) for most states, but for TASK_IDLE and TASK_RTLOCK_WAIT
it does not.

So if a task is waiting TASK_IDLE|TASK_FREEZABLE it gets incorrectly
reported as TASK_UNINTERRUPTIBLE or "D".  (it is planned for nfsd to
change to use this state).

Fix this by only testing the interesting bits and not the irrelevant
bits in __task_state_index()

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/169335025927.5133.4781141800413736103@noble.neil.brown.name
Stable-dep-of: f718faf3940e ("freezer, sched: Report frozen tasks as 'D' instead of 'R'")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/sched.h