]> git.baikalelectronics.ru Git - kernel.git/commit
sched: Fix TASK_state comparisons
authorPeter Zijlstra <peterz@infradead.org>
Tue, 27 Sep 2022 19:02:34 +0000 (21:02 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 28 Sep 2022 08:00:16 +0000 (10:00 +0200)
commite285e6008247bc577220b458b27fb3064889825e
tree0b191d9fffa590cbca17596e8c8c1147a42d14dc
parentd393ff36dcf21bd1ff3e53031be9b3be247f82e5
sched: Fix TASK_state comparisons

Task state is fundamentally a bitmask; direct comparisons are probably
not working as intended. Specifically the normal wait-state have
a number of possible modifiers:

  TASK_UNINTERRUPTIBLE: TASK_WAKEKILL, TASK_NOLOAD, TASK_FREEZABLE
  TASK_INTERRUPTIBLE:   TASK_FREEZABLE

Specifically, the addition of TASK_FREEZABLE wrecked
__wait_is_interruptible(). This however led to an audit of direct
comparisons yielding the rest of the changes.

Fixes: c1c703291ea4 ("freezer,sched: Rewrite core freezer logic")
Reported-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Debugged-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Christian Borntraeger <borntraeger@linux.ibm.com>
include/linux/wait.h
kernel/hung_task.c
kernel/sched/core.c