2020-09-04 20:10:21 +00:00
|
|
|
From da619e2c9a6272d7e6507460e3f38d20fbaa7393 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <da619e2c9a6272d7e6507460e3f38d20fbaa7393.1599166690.git.zanussi@kernel.org>
|
|
|
|
In-Reply-To: <56457dc415803c8abc5acb513ada877a79596f05.1599166690.git.zanussi@kernel.org>
|
|
|
|
References: <56457dc415803c8abc5acb513ada877a79596f05.1599166690.git.zanussi@kernel.org>
|
2018-08-27 14:32:32 +00:00
|
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
Date: Wed, 15 Nov 2017 17:29:51 +0100
|
2020-09-04 20:10:21 +00:00
|
|
|
Subject: [PATCH 097/333] time/hrtimer: avoid schedule_work() with interrupts
|
2019-04-08 23:49:20 +00:00
|
|
|
disabled
|
2020-09-04 20:10:21 +00:00
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.142-rt63.tar.xz
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
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>
|
|
|
|
---
|
2019-04-08 23:49:20 +00:00
|
|
|
kernel/time/timer.c | 15 +++++++++++----
|
2018-08-27 14:32:32 +00:00
|
|
|
1 file changed, 11 insertions(+), 4 deletions(-)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
|
2020-09-04 20:10:21 +00:00
|
|
|
index ecc23d2c21a9..753b75751f0a 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/kernel/time/timer.c
|
|
|
|
+++ b/kernel/time/timer.c
|
2020-09-04 20:10:21 +00:00
|
|
|
@@ -218,8 +218,7 @@ static DEFINE_PER_CPU(struct timer_base, timer_bases[NR_BASES]);
|
2018-08-27 14:32:32 +00:00
|
|
|
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);
|
|
|
|
+static struct swork_event timer_update_swork;
|
|
|
|
|
|
|
|
#ifdef CONFIG_SMP
|
|
|
|
unsigned int sysctl_timer_migration = 1;
|
2020-09-04 20:10:21 +00:00
|
|
|
@@ -237,7 +236,7 @@ static void timers_update_migration(void)
|
2018-08-27 14:32:32 +00:00
|
|
|
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 swork_event *event)
|
|
|
|
{
|
|
|
|
mutex_lock(&timer_keys_mutex);
|
|
|
|
timers_update_migration();
|
2020-09-04 20:10:21 +00:00
|
|
|
@@ -247,9 +246,17 @@ static void timer_update_keys(struct work_struct *work)
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
void timers_update_nohz(void)
|
|
|
|
{
|
|
|
|
- schedule_work(&timer_update_work);
|
|
|
|
+ swork_queue(&timer_update_swork);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static __init int hrtimer_init_thread(void)
|
|
|
|
+{
|
|
|
|
+ WARN_ON(swork_get());
|
|
|
|
+ INIT_SWORK(&timer_update_swork, timer_update_keys);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+early_initcall(hrtimer_init_thread);
|
|
|
|
+
|
|
|
|
int timer_migration_handler(struct ctl_table *table, int write,
|
|
|
|
void __user *buffer, size_t *lenp,
|
|
|
|
loff_t *ppos)
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-06-22 13:14:16 +00:00
|
|
|
2.17.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|