John Stultz
6b43ae8a61
ntp: Fix leap-second hrtimer livelock
...
Since commit 7dffa3c673 the ntp
subsystem has used an hrtimer for triggering the leapsecond
adjustment. However, this can cause a potential livelock.
Thomas diagnosed this as the following pattern:
CPU 0 CPU 1
do_adjtimex()
spin_lock_irq(&ntp_lock);
process_adjtimex_modes(); timer_interrupt()
process_adj_status(); do_timer()
ntp_start_leap_timer(); write_lock(&xtime_lock);
hrtimer_start(); update_wall_time();
hrtimer_reprogram(); ntp_tick_length()
tick_program_event() spin_lock(&ntp_lock);
clockevents_program_event()
ktime_get()
seq = req_seqbegin(xtime_lock);
This patch tries to avoid the problem by reverting back to not using
an hrtimer to inject leapseconds, and instead we handle the leapsecond
processing in the second_overflow() function.
The downside to this change is that on systems that support highres
timers, the leap second processing will occur on a HZ tick boundary,
(ie: ~1-10ms, depending on HZ) after the leap second instead of
possibly sooner (~34us in my tests w/ x86_64 lapic).
This patch applies on top of tip/timers/core.
CC: Sasha Levin <levinsasha928@gmail.com >
CC: Thomas Gleixner <tglx@linutronix.de >
Reported-by: Sasha Levin <levinsasha928@gmail.com >
Diagnoised-by: Thomas Gleixner <tglx@linutronix.de >
Tested-by: Sasha Levin <levinsasha928@gmail.com >
Signed-off-by: John Stultz <john.stultz@linaro.org >
2012-03-22 19:43:43 -07:00
..
2012-01-17 18:40:24 -08:00
2012-01-17 09:54:08 -05:00
2012-01-04 17:30:20 -02:00
2012-01-09 00:37:40 +01:00
2011-12-30 15:25:52 -08:00
2012-01-13 09:32:20 +10:30
2012-02-03 19:03:44 +01:00
2012-01-22 15:08:43 -05:00
2012-02-13 20:39:05 -05:00
2012-02-04 07:17:47 -08:00
2012-01-16 14:01:23 +01:00
2011-12-27 20:31:38 +01:00
2012-01-03 09:10:09 +01:00
2012-01-09 14:21:03 -08:00
2012-01-06 05:22:21 +04:00
2011-12-23 10:17:51 +11:00
2012-01-03 20:20:01 +00:00
2012-01-14 12:26:41 -08:00
2012-02-01 15:56:19 -08:00
2012-01-17 04:35:20 -05:00
2012-01-18 15:51:48 -08:00
2012-01-08 19:14:59 -05:00
2012-01-17 16:17:03 -05:00
2012-02-06 15:15:20 -08:00
2012-01-13 08:15:33 +01:00
2012-02-07 07:51:30 +01:00
2012-01-14 18:36:33 -08:00
2012-02-08 20:03:14 +01:00
2012-01-09 12:59:24 -08:00
2011-12-28 21:25:35 +08:00
2012-02-01 18:37:39 -08:00
2012-01-03 22:55:19 -05:00
2012-01-10 16:30:42 -08:00
2012-01-10 16:30:42 -08:00
2012-01-03 22:54:57 -05:00
2012-01-13 09:32:20 +10:30
2012-01-07 12:03:30 -08:00
2012-01-18 15:51:48 -08:00
2012-01-12 20:13:11 -08:00
2012-01-05 18:52:59 -05:00
2012-01-13 10:29:21 -08:00
2012-01-08 12:19:57 -08:00
2012-01-24 10:47:41 -08:00
2012-01-18 10:46:21 +11:00
2012-01-04 08:56:31 -06:00
2012-01-06 10:20:21 +00:00
2011-12-23 21:33:15 +05:30
2012-02-08 09:19:42 +01:00
2012-01-04 14:10:28 -05:00
2012-01-12 20:13:04 -08:00
2012-01-03 22:54:58 -05:00
2012-01-29 20:35:52 +01:00
2012-01-23 17:17:45 -08:00
2012-01-07 17:26:49 -05:00
2012-01-03 22:54:55 -05:00
2012-01-10 16:30:43 -08:00
2012-01-11 09:23:05 +00:00
2012-02-01 09:13:11 -08:00
2012-01-09 11:24:59 +01:00
2012-01-12 20:13:08 -08:00
2012-02-02 14:35:12 -05:00
2012-01-06 11:42:52 -08:00
2012-01-03 22:54:56 -05:00
2012-01-24 15:51:00 -05:00
2012-01-11 12:56:06 -08:00
2012-01-09 12:59:24 -08:00
2012-01-13 09:32:18 +10:30
2012-02-07 07:51:30 +01:00
2012-01-09 13:06:28 +01:00
2012-01-03 22:55:17 -05:00
2011-12-23 22:33:58 +00:00
2012-01-03 22:54:55 -05:00
2011-12-28 17:46:46 -05:00
2012-01-09 13:52:09 +01:00
2011-12-30 16:42:19 -05:00
2012-01-12 20:13:03 -08:00
2012-01-23 08:38:48 -08:00
2012-01-19 16:17:35 +11:00
2012-01-12 20:13:11 -08:00
2011-12-21 15:13:54 -08:00
2012-01-17 15:40:51 -08:00
2011-12-27 11:24:29 +02:00
2011-12-27 11:26:41 +02:00
2011-12-26 13:27:44 +02:00
2012-01-10 16:30:49 -08:00
2011-12-22 02:02:20 -05:00
2012-01-12 20:13:03 -08:00
2012-02-02 15:43:40 -08:00
2012-03-15 21:41:34 +01:00
2012-01-12 20:13:07 -08:00
2011-12-21 14:48:43 -08:00
2012-01-10 16:30:45 -08:00
2012-01-23 08:38:47 -08:00
2012-01-23 08:38:47 -08:00
2012-01-13 10:12:23 -08:00
2012-01-12 20:13:10 -08:00
2012-01-12 20:13:03 -08:00
2012-01-11 19:12:10 -08:00
2012-01-12 20:13:10 -08:00
2012-01-03 22:57:13 -05:00
2012-01-20 17:38:58 +00:00
2012-01-13 09:32:14 +10:30
2012-01-13 09:32:28 +10:30
2012-01-03 22:57:12 -05:00
2012-02-02 00:23:14 +11:00
2012-01-06 12:10:25 -08:00
2012-01-09 14:46:52 -08:00
2012-01-04 14:30:43 -05:00
2012-01-05 11:59:18 -05:00
2012-01-03 22:52:34 -05:00
2012-01-07 13:22:46 -05:00
2012-01-07 13:22:46 -05:00
2011-12-21 14:48:43 -08:00
2011-12-27 10:57:13 -06:00
2012-01-07 12:18:52 -08:00
2012-01-12 20:13:06 -08:00
2012-01-12 20:13:07 -08:00
2012-01-10 16:30:42 -08:00
2012-01-12 20:13:10 -08:00
2012-01-06 12:11:40 -08:00
2012-01-11 18:50:26 -08:00
2012-01-06 12:10:26 -08:00
2012-01-06 12:15:21 -08:00
2011-12-22 10:40:20 -08:00
2012-01-27 12:06:39 +01:00
2012-01-12 15:23:04 -08:00
2012-01-10 16:30:54 -08:00
2012-01-12 20:05:28 -08:00
2012-01-08 13:10:57 -08:00
2012-02-04 22:23:17 +01:00
2011-12-25 23:43:05 +01:00
2012-01-04 09:09:35 +04:00
2012-01-12 20:13:13 -08:00
2012-01-10 16:30:54 -08:00
2012-02-01 16:53:46 +08:00
2012-01-17 16:41:31 -08:00
2012-01-12 13:09:09 +01:00
2012-01-12 20:13:12 -08:00
2012-01-03 22:55:07 -05:00
2012-01-06 23:20:13 -05:00
2012-01-06 23:20:13 -05:00
2012-01-03 22:54:56 -05:00
2012-01-22 15:08:46 -05:00
2012-01-12 20:13:06 -08:00
2012-03-15 18:23:10 -07:00
2012-01-06 06:13:35 +04:00
2012-02-02 12:55:17 -08:00
2012-01-14 18:36:33 -08:00
2012-01-03 22:52:40 -05:00
2012-01-14 13:05:21 -08:00
2012-02-01 22:23:53 +05:30
2011-12-25 23:39:11 +01:00
2012-01-09 09:33:57 +09:00
2012-01-23 08:38:48 -08:00
2012-01-10 16:30:54 -08:00
2012-01-05 14:01:21 -05:00
2012-01-09 14:19:33 -08:00
2012-01-03 20:23:18 -05:00
2012-01-22 15:08:44 -05:00
2011-12-30 16:42:19 -05:00
2012-01-19 23:25:33 +01:00
2012-01-23 08:38:48 -08:00
2012-01-03 22:55:19 -05:00
2012-01-03 22:55:12 -05:00
2012-01-03 22:54:56 -05:00
2012-01-23 03:15:25 -05:00
2012-03-22 19:43:43 -07:00
2012-01-17 10:30:38 -08:00
2012-01-08 13:21:22 -08:00
2012-01-04 22:19:55 -08:00
2011-12-30 16:46:02 -05:00
2012-01-24 12:25:14 -08:00
2012-01-15 12:49:56 -08:00
2012-01-12 15:44:42 +10:30
2012-01-12 15:44:44 +10:30
2012-01-06 15:22:04 +01:00
2012-01-10 16:30:54 -08:00
2012-01-10 16:59:59 -08:00