summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/time-hrtimer-avoid-schedule_work-with-interrupts-dis.patch
blob: df187a72e55ec25ead58073c5f72fdfd58411fe6 (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
43
44
45
46
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 15 Nov 2017 17:29:51 +0100
Subject: [PATCH] time/hrtimer: avoid schedule_work() with interrupts disabled
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.0/older/patches-5.0.7-rt5.tar.xz

The NOHZ code tries to schedule a workqueue with interrupts disabled.
Since this does not work -RT I am switching it to swork instead.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/time/timer.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -216,9 +216,6 @@ static DEFINE_PER_CPU(struct timer_base,
 static DEFINE_STATIC_KEY_FALSE(timers_nohz_active);
 static DEFINE_MUTEX(timer_keys_mutex);
 
-static void timer_update_keys(struct work_struct *work);
-static DECLARE_WORK(timer_update_work, timer_update_keys);
-
 #ifdef CONFIG_SMP
 unsigned int sysctl_timer_migration = 1;
 
@@ -235,17 +232,18 @@ static void timers_update_migration(void
 static inline void timers_update_migration(void) { }
 #endif /* !CONFIG_SMP */
 
-static void timer_update_keys(struct work_struct *work)
+static void timer_update_keys(struct kthread_work *work)
 {
 	mutex_lock(&timer_keys_mutex);
 	timers_update_migration();
 	static_branch_enable(&timers_nohz_active);
 	mutex_unlock(&timer_keys_mutex);
 }
+static DEFINE_KTHREAD_WORK(timer_update_swork, timer_update_keys);
 
 void timers_update_nohz(void)
 {
-	schedule_work(&timer_update_work);
+	kthread_schedule_work(&timer_update_swork);
 }
 
 int timer_migration_handler(struct ctl_table *table, int write,