sched: Switch wait_task_inactive to schedule_hrtimeout()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 23 Feb 2011 23:52:21 +0000 (23:52 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 25 Feb 2011 19:24:22 +0000 (20:24 +0100)
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>

kernel/sched.c

index 18d38e4ec7ba249ba46079beab5a773700a7eb3b..66ca5d9ba83ce561503ce5826f5c6808103902af 100644 (file)
@@ -2224,7 +2224,10 @@ unsigned long wait_task_inactive(struct task_struct *p, long match_state)
                 * yield - it could be a while.
                 */
                if (unlikely(on_rq)) {
-                       schedule_timeout_uninterruptible(1);
+                       ktime_t to = ktime_set(0, NSEC_PER_SEC/HZ);
+
+                       set_current_state(TASK_UNINTERRUPTIBLE);
+                       schedule_hrtimeout(&to, HRTIMER_MODE_REL);
                        continue;
                }
 
This page took 0.075725 seconds and 5 git commands to generate.