summaryrefslogtreecommitdiffstats
path: root/kthreads-fix-softirq-startup-hang.patch
blob: a9608afbc52fae07ff40dbca8df39c2e5e82dd69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 87bb117bc729cec2739aac8d16f49b4d28867f0c 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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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