From 87bb117bc729cec2739aac8d16f49b4d28867f0c Mon Sep 17 00:00:00 2001 From: Thomas Gleixner 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 Signed-off-by: Paul Gortmaker --- kernel/sched.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index bb47604..22c233e 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2220,7 +2220,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.0.4