Skip to content

Commit 8eb90c3

Browse files
committed
sched: Switch wait_task_inactive to schedule_hrtimeout()
When we force thread hard and soft interrupts the startup of ksoftirqd would hang in kthread_bind() when wait_task_inactive() calls schedule_timeout_uninterruptible() because there is no softirq yet which will wake us up. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <20110223234956.677109139@linutronix.de>
1 parent 0c4602f commit 8eb90c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/sched.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,10 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
22242224
* yield - it could be a while.
22252225
*/
22262226
if (unlikely(on_rq)) {
2227-
schedule_timeout_uninterruptible(1);
2227+
ktime_t to = ktime_set(0, NSEC_PER_SEC/HZ);
2228+
2229+
set_current_state(TASK_UNINTERRUPTIBLE);
2230+
schedule_hrtimeout(&to, HRTIMER_MODE_REL);
22282231
continue;
22292232
}
22302233

0 commit comments

Comments
 (0)