[PATCH] sched/core: aplly TASK_RUNNING in state judgement
From: Liu Peibao
Date: Tue Nov 23 2021 - 10:03:20 EST
Looks more clearly.
Signed-off-by: Liu Peibao <liupeibao@xxxxxxx>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3c9b0fd..abafd2e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6181,7 +6181,7 @@ static void __sched notrace __schedule(unsigned int sched_mode)
* - ptrace_{,un}freeze_traced() can change ->state underneath us.
*/
prev_state = READ_ONCE(prev->__state);
- if (!(sched_mode & SM_MASK_PREEMPT) && prev_state) {
+ if (!(sched_mode & SM_MASK_PREEMPT) && (prev_state != TASK_RUNNING)) {
if (signal_pending_state(prev_state, prev)) {
WRITE_ONCE(prev->__state, TASK_RUNNING);
} else {
--
1.8.3.1