freezer,sched: Preventing kthreads with D-state from being woken up during freeze
RFC PATCH 1/1 freezer,sched: Preventing kthreads with D-state from being woken up during freeze
Sometimes althought a kthread was set to be freezable, the thread's state also could be TASK_UNINTERRUPTIBLE because of some blocked reasons, such as msleep, wait_for_complete, mutex and so on... And now, when freezing, the freezer would wakeup them even if their conditions have not been met, this may not be necessary, and sometimes waking up early for schedule_timeout() may cause some driver functions to fail.
So only wake_up kthreads with TASK_INTERRUPTIBLE state.
Co-developed-by Guohua Yan <[email protected]>
Signed-off-by Guohua Yan <[email protected]>
Signed-off-by Xuewen Yan <[email protected]>
--- kernel/freezer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/freezer.c +1 -1
@@ -168,7 +168,7 @@ bool freeze_task(struct task_struct *p)if (!(p->flags &PF_KTHREAD ))fake_signal_wake_up (p);else -wake_up_state (p,TASK_NORMAL ); +wake_up_state (p,TASK_INTERRUPTIBLE );spin_unlock_irqrestore (&freezer_lock, flags);return true;
Signature · 1 line
2.25.1