[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <158125695732.26104.9630376117953711880.tglx@nanos.tec.linutronix.de>
Date: Sun, 09 Feb 2020 14:02:37 -0000
From: Thomas Gleixner <tglx@...utronix.de>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org
Subject: [GIT pull] time(r) fixes for 5.6-rc1
Linus,
please pull the latest timers/urgent branch from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers-urgent-2020-02-09
up to: febac332a819: clocksource: Prevent double add_timer_on() for watchdog_timer
Two small fixes for the time(r) subsystem:
- Handle a subtle race between the clocksource watchdog and a concurrent
clocksource watchdog stop/start sequence correctly to prevent a timer
double add bug.
- Fix the file path for the core time namespace file.
Thanks,
tglx
------------------>
Dmitry Safonov (1):
MAINTAINERS: Correct path to time namespace source file
Konstantin Khlebnikov (1):
clocksource: Prevent double add_timer_on() for watchdog_timer
MAINTAINERS | 2 +-
kernel/time/clocksource.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 141b8d3e4ca2..3a4163be98da 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13267,7 +13267,7 @@ S: Maintained
F: fs/timerfd.c
F: include/linux/timer*
F: include/linux/time_namespace.h
-F: kernel/time_namespace.c
+F: kernel/time/namespace.c
F: kernel/time/*timer*
POWER MANAGEMENT CORE
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index fff5f64981c6..428beb69426a 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -293,8 +293,15 @@ static void clocksource_watchdog(struct timer_list *unused)
next_cpu = cpumask_next(raw_smp_processor_id(), cpu_online_mask);
if (next_cpu >= nr_cpu_ids)
next_cpu = cpumask_first(cpu_online_mask);
- watchdog_timer.expires += WATCHDOG_INTERVAL;
- add_timer_on(&watchdog_timer, next_cpu);
+
+ /*
+ * Arm timer if not already pending: could race with concurrent
+ * pair clocksource_stop_watchdog() clocksource_start_watchdog().
+ */
+ if (!timer_pending(&watchdog_timer)) {
+ watchdog_timer.expires += WATCHDOG_INTERVAL;
+ add_timer_on(&watchdog_timer, next_cpu);
+ }
out:
spin_unlock(&watchdog_lock);
}
Powered by blists - more mailing lists