summaryrefslogtreecommitdiffstats
path: root/sched-enable-irqs-in-fire_sched_in_preempt_notifier.patch
blob: cfdcf27dbbe8f9b099f66e728a5cd1b6de587527 (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
37
38
39
40
41
42
From 77b8b33c220d948edbe743181a3df705becddab9 Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 3 Jul 2009 13:16:25 -0500
Subject: [PATCH] sched: enable irqs in fire_sched_in_preempt_notifier

commit 54afe8908e5645ae6d5d8a8a3ea0b7e81076d2d5 in tip.

KVM expects the notifier call with irqs enabled. It's necessary due
to a possible IPI call. Make the preempt-rt version behave the same
way as mainline.

Signed-off-by: Thomas Gleixner <tgxl@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 kernel/sched.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index a194f62..a39592e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2833,8 +2833,17 @@ static void fire_sched_in_preempt_notifiers(struct task_struct *curr)
 	struct preempt_notifier *notifier;
 	struct hlist_node *node;
 
+	if (hlist_empty(&curr->preempt_notifiers))
+		return;
+
+	/*
+	 * The KVM sched in notifier expects to be called with
+	 * interrupts enabled.
+	 */
+	local_irq_enable();
 	hlist_for_each_entry(notifier, node, &curr->preempt_notifiers, link)
 		notifier->ops->sched_in(notifier, raw_smp_processor_id());
+	local_irq_disable();
 }
 
 static void
-- 
1.7.0.4