blob: 3aed708d6b389d05a63e6962ddd6da2bce50e01e [file] [log] [blame]
From e9046c88a629dec6e3aa31fdc459ee14438b1314 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 21 Jul 2009 16:03:38 +0200
Subject: [PATCH] kthreads: fix softirq startup hang
commit 0dc6c39e33b193bdf9bfab265c24a03108526bff in tip.
In -rt where the timer softirq is forced threaded the
schedule_timeout_uninterruptible() might never return when the timer
softirq has not been started yet. Use schedule_hrtimeout() instead
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
diff --git a/kernel/sched.c b/kernel/sched.c
index c19ddb3..b859b1e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2219,7 +2219,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;
}
--
1.7.1.1