Jason Wessel
d6ad3e286d
softlockup: Add sched_clock_tick() to avoid kernel warning on kgdb resume
...
When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, sched_clock() gets
the time from hardware such as the TSC on x86. In this
configuration kgdb will report a softlock warning message on
resuming or detaching from a debug session.
Sequence of events in the problem case:
1) "cpu sched clock" and "hardware time" are at 100 sec prior
to a call to kgdb_handle_exception()
2) Debugger waits in kgdb_handle_exception() for 80 sec and on
exit the following is called ... touch_softlockup_watchdog() -->
__raw_get_cpu_var(touch_timestamp) = 0;
3) "cpu sched clock" = 100s (it was not updated, because the
interrupt was disabled in kgdb) but the "hardware time" = 180 sec
4) The first timer interrupt after resuming from
kgdb_handle_exception updates the watchdog from the "cpu sched clock"
update_process_times() { ... run_local_timers() -->
softlockup_tick() --> check (touch_timestamp == 0) (it is "YES"
here, we have set "touch_timestamp = 0" at kgdb) -->
__touch_softlockup_watchdog() ***(A)--> reset "touch_timestamp"
to "get_timestamp()" (Here, the "touch_timestamp" will still be
set to 100s.) ...
scheduler_tick() ***(B)--> sched_clock_tick() (update "cpu sched
clock" to "hardware time" = 180s) ... }
5) The Second timer interrupt handler appears to have a large
jump and trips the softlockup warning.
update_process_times() { ... run_local_timers() -->
softlockup_tick() --> "cpu sched clock" - "touch_timestamp" =
180s-100s > 60s --> printk "soft lockup error messages" ... }
note: ***(A) reset "touch_timestamp" to
"get_timestamp(this_cpu)"
Why is "touch_timestamp" 100 sec, instead of 180 sec?
When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, the call trace of
get_timestamp() is:
get_timestamp(this_cpu)
-->cpu_clock(this_cpu)
-->sched_clock_cpu(this_cpu)
-->__update_sched_clock(sched_clock_data, now)
The __update_sched_clock() function uses the GTOD tick value to
create a window to normalize the "now" values. So if "now"
value is too big for sched_clock_data, it will be ignored.
The fix is to invoke sched_clock_tick() to update "cpu sched
clock" in order to recover from this state. This is done by
introducing the function touch_softlockup_watchdog_sync(). This
allows kgdb to request that the sched clock is updated when the
watchdog thread runs the first time after a resume from kgdb.
[yong.zhang0@gmail.com: Use per cpu instead of an array]
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Dongdong Deng <Dongdong.Deng@windriver.com>
Cc: kgdb-bugreport@lists.sourceforge.net
Cc: peterz@infradead.org
LKML-Reference: <1264631124-4837-2-git-send-email-jason.wessel@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2010-02-01 08:22:32 +01:00
..
2009-09-22 20:49:04 +01:00
2009-12-13 19:47:42 -08:00
2010-01-11 09:34:04 -08:00
2009-09-19 00:51:34 -03:00
2010-01-11 09:34:07 -08:00
2009-12-09 19:52:01 -08:00
2009-09-22 07:54:33 -07:00
2010-01-18 12:30:27 +01:00
2009-11-12 11:19:44 -08:00
2009-11-18 22:19:03 -08:00
2010-01-13 09:04:53 +00:00
2009-12-03 13:23:12 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-15 15:01:46 -05:00
2009-12-14 12:49:47 +11:00
2009-12-17 10:27:27 +00:00
2009-12-17 15:59:05 -08:00
2009-10-27 16:47:55 -04:00
2009-12-16 10:47:44 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-09-24 07:21:05 -07:00
2009-12-23 08:53:31 -08:00
2009-10-19 15:55:59 +09:00
2010-01-06 16:18:15 -05:00
2009-09-27 11:39:25 -07:00
2009-12-16 07:20:13 -08:00
2009-09-23 07:39:29 -07:00
2009-09-01 01:14:07 -07:00
2009-09-08 17:42:50 -07:00
2009-12-03 18:01:23 -05:00
2009-09-30 16:12:20 -07:00
2009-12-15 08:53:35 -08:00
2009-09-15 09:50:47 -07:00
2009-10-29 13:59:26 +01:00
2009-12-16 11:33:46 +00:00
2009-12-17 15:45:31 -08:00
2009-11-26 09:16:19 +01:00
2009-12-16 07:20:18 -08:00
2009-09-11 14:33:32 +02:00
2010-01-11 14:29:20 +01:00
2009-10-01 21:19:34 +02:00
2009-11-10 12:31:43 +01:00
2009-11-02 23:39:15 -08:00
2009-11-24 15:06:47 +11:00
2009-12-04 23:41:47 +01:00
2009-12-03 19:28:51 +01:00
2009-10-01 16:11:11 -07:00
2009-12-04 15:39:55 +01:00
2009-11-13 20:46:24 +01:00
2009-12-08 19:28:09 -08:00
2009-09-23 07:39:29 -07:00
2009-11-08 20:57:03 -08:00
2009-12-05 15:32:03 -08:00
2009-11-02 15:47:54 +01:00
2009-12-05 15:32:03 -08:00
2009-09-24 07:20:57 -07:00
2009-11-25 17:57:36 +01:00
2009-12-09 17:09:36 +11:00
2009-11-24 13:33:34 -05:00
2009-12-06 21:10:56 +01:00
2009-09-23 11:01:25 -07:00
2009-10-19 12:58:55 +09:00
2009-12-02 22:07:23 -08:00
2009-12-15 08:53:28 -08:00
2009-12-15 08:53:32 -08:00
2009-09-19 13:13:31 -07:00
2009-09-10 10:00:05 -07:00
2009-09-01 01:24:30 -07:00
2009-09-24 07:20:57 -07:00
2009-09-18 09:48:52 -07:00
2009-12-10 23:52:27 +00:00
2009-12-23 11:23:43 -08:00
2009-12-10 23:52:01 +00:00
2009-12-10 23:52:22 +00:00
2009-11-09 09:40:57 +01:00
2009-12-10 23:52:05 +00:00
2009-08-28 14:24:10 +10:00
2009-12-10 23:43:19 -07:00
2009-12-08 19:26:55 -08:00
2009-09-08 21:17:48 -04:00
2009-11-04 09:50:58 -08:00
2009-11-04 15:20:57 +01:00
2010-01-12 10:02:46 +01:00
2009-10-01 21:17:49 +02:00
2010-01-12 10:14:42 +01:00
2009-09-14 17:41:42 -07:00
2009-12-15 08:53:25 -08:00
2009-12-15 08:53:33 -08:00
2009-12-18 17:43:32 +01:00
2009-12-10 08:54:14 -06:00
2009-12-15 08:53:27 -08:00
2009-11-04 09:50:58 -08:00
2009-12-03 13:18:04 -08:00
2010-01-25 12:26:38 -02:00
2009-10-27 19:34:04 -04:00
2009-12-10 15:02:51 +01:00
2009-11-11 15:22:49 +01:00
2009-12-23 13:44:12 +01:00
2009-12-10 15:02:53 +01:00
2009-12-23 13:33:54 +01:00
2009-12-10 09:34:40 -08:00
2009-12-03 12:14:36 -08:00
2009-12-17 20:55:57 -08:00
2009-12-16 12:16:42 -05:00
2009-11-04 09:50:58 -08:00
2009-12-29 19:58:16 +01:00
2009-12-29 19:58:16 +01:00
2009-12-11 11:24:52 -08:00
2009-09-22 07:17:47 -07:00
2009-12-17 10:58:17 -05:00
2010-01-14 09:05:26 -05:00
2009-11-19 18:12:05 +00:00
2009-11-19 18:11:35 +00:00
2009-11-24 17:00:27 +11:00
2009-12-13 18:37:28 +01:00
2009-10-07 15:52:09 -04:00
2009-10-08 12:16:35 -07:00
2009-11-04 09:50:58 -08:00
2009-12-16 12:16:49 -05:00
2010-01-11 14:32:44 +01:00
2009-09-23 07:39:29 -07:00
2009-12-03 11:58:47 +00:00
2009-12-08 20:30:41 -08:00
2009-12-16 07:20:01 -08:00
2009-10-26 09:40:29 +01:00
2009-09-01 01:13:31 -07:00
2009-11-05 14:08:03 +01:00
2010-01-11 09:34:03 -08:00
2009-08-27 23:33:20 +02:00
2009-12-14 23:55:34 +01:00
2009-12-15 08:53:12 -08:00
2009-12-14 10:10:55 -08:00
2009-12-01 14:47:32 +08:00
2009-09-19 00:16:14 -03:00
2009-11-20 00:25:42 +00:00
2009-12-14 21:17:29 +01:00
2009-12-11 23:55:42 -08:00
2009-11-17 10:16:32 -05:00
2009-12-02 21:58:33 -08:00
2009-12-21 11:32:27 -05:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-08 20:42:28 -08:00
2009-11-04 09:50:58 -08:00
2009-09-07 01:56:33 -07:00
2009-11-04 09:50:58 -08:00
2009-11-26 15:53:10 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-11-26 16:00:36 -08:00
2009-11-19 11:08:54 -05:00
2009-11-04 09:50:58 -08:00
2009-12-16 12:16:47 -05:00
2009-12-09 19:43:33 -08:00
2009-11-04 09:50:58 -08:00
2009-12-25 17:30:22 -08:00
2009-12-17 13:23:24 -08:00
2009-12-15 20:42:06 +01:00
2009-11-20 00:52:09 -08:00
2009-12-02 23:38:13 -08:00
2009-10-05 07:55:22 +01:00
2009-11-04 14:22:21 +01:00
2009-08-26 15:41:16 -07:00
2010-01-11 14:29:20 +01:00
2009-12-16 07:20:18 -08:00
2009-12-16 07:20:17 -08:00
2009-11-04 09:50:58 -08:00
2009-12-16 07:20:10 -08:00
2009-09-26 10:17:19 -07:00
2009-10-18 18:52:53 -07:00
2009-12-14 23:55:33 +01:00
2009-10-23 08:28:10 +02:00
2009-08-29 15:53:00 +02:00
2009-11-15 22:23:47 -08:00
2009-12-11 15:18:07 -08:00
2009-12-23 06:52:08 -05:00
2009-09-23 07:39:58 -07:00
2009-11-26 12:59:20 +01:00
2009-12-15 08:53:26 -08:00
2009-12-12 13:08:15 +01:00
2009-10-25 17:31:30 +01:00
2009-12-16 12:19:59 +01:00
2010-01-16 12:15:39 -08:00
2009-12-16 07:20:13 -08:00
2009-09-02 21:29:22 +10:00
2009-09-02 21:29:22 +10:00
2010-01-16 12:15:38 -08:00
2010-01-07 11:58:37 -06:00
2010-01-11 09:34:04 -08:00
2009-10-28 15:11:00 +00:00
2009-12-31 19:45:04 +00:00
2009-09-23 23:08:43 +02:00
2009-09-26 10:17:19 -07:00
2009-12-16 06:56:12 -08:00
2009-12-03 09:32:17 +02:00
2009-09-10 08:33:20 +03:00
2009-12-09 17:14:38 +11:00
2009-12-17 11:41:51 +00:00
2009-12-17 11:33:33 +00:00
2009-12-17 11:27:09 +00:00
2010-01-12 14:34:14 -05:00
2009-09-17 23:23:45 -07:00
2009-09-21 06:27:08 +02:00
2009-12-15 08:53:36 -08:00
2010-01-12 21:02:00 -08:00
2009-12-12 22:24:32 -07:00
2009-10-01 21:17:49 +02:00
2009-11-10 09:33:46 +11:00
2009-09-23 07:39:42 -07:00
2009-12-16 12:36:49 -08:00
2009-12-15 08:53:20 -08:00
2009-12-18 14:53:36 +11:00
2009-12-15 08:53:12 -08:00
2009-09-22 07:17:35 -07:00
2009-12-15 08:53:20 -08:00
2009-09-19 12:50:38 -07:00
2009-09-21 15:14:56 +02:00
2009-09-22 07:17:37 -07:00
2010-01-16 12:15:40 -08:00
2010-01-16 12:15:40 -08:00
2009-12-12 13:08:15 +01:00
2009-09-22 07:17:42 -07:00
2009-09-22 07:17:31 -07:00
2009-12-12 13:08:14 +01:00
2009-12-17 12:51:05 -08:00
2009-09-23 07:39:43 -07:00
2009-12-15 16:28:26 +10:30
2009-10-29 08:56:17 +10:30
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-22 12:27:34 -05:00
2009-11-04 09:50:58 -08:00
2009-12-05 15:22:26 -08:00
2009-12-03 15:59:22 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-05 16:08:40 -05:00
2009-12-04 15:55:38 -05:00
2009-09-26 10:17:19 -07:00
2009-12-16 10:43:34 -08:00
2009-12-14 18:12:08 -05:00
2009-11-20 10:05:52 +09:00
2009-11-28 15:05:05 -05:00
2009-11-06 14:32:24 +03:00
2009-12-15 08:53:13 -08:00
2009-12-15 08:53:13 -08:00
2009-12-01 16:15:50 -08:00
2009-12-15 08:53:12 -08:00
2009-10-15 10:58:07 -06:00
2009-10-15 10:58:09 -06:00
2009-12-09 12:12:44 +02:00
2009-12-16 07:19:57 -08:00
2009-12-16 07:20:07 -08:00
2009-12-17 07:23:42 -08:00
2009-08-22 13:07:09 +02:00
2009-09-14 17:39:12 -07:00
2009-12-12 14:27:24 -08:00
2009-11-04 13:06:36 -08:00
2010-01-04 15:41:47 -08:00
2009-12-04 15:56:19 -08:00
2009-10-29 22:34:12 +09:00
2009-12-08 10:02:12 +09:00
2010-01-21 13:40:40 +01:00
2009-09-24 15:38:57 -07:00
2010-01-19 01:59:02 -08:00
2009-11-04 09:50:58 -08:00
2009-11-04 09:50:58 -08:00
2009-12-04 15:39:55 +01:00
2009-12-11 11:24:55 -08:00
2009-12-14 23:55:33 +01:00
2009-12-06 16:17:57 +01:00
2009-12-15 08:53:25 -08:00
2009-12-15 17:35:26 -05:00
2010-01-11 09:45:37 -08:00
2009-10-04 15:05:10 -07:00
2009-12-03 11:43:23 +00:00
2009-10-04 03:23:17 +02:00
2009-12-02 09:55:33 +01:00
2009-09-23 07:39:41 -07:00
2009-12-16 07:20:08 -08:00
2009-12-17 11:46:01 +00:00
2009-12-23 13:33:54 +01:00
2009-09-22 07:17:24 -07:00
2009-09-27 11:39:25 -07:00
2009-10-23 17:26:37 +02:00
2009-09-19 08:53:22 +02:00
2009-11-10 22:26:29 -08:00
2009-11-22 18:58:16 +01:00
2009-12-17 09:46:44 +01:00
2009-12-17 09:46:44 +01:00
2009-10-30 15:06:37 -07:00
2009-09-14 07:18:25 +02:00
2010-01-02 11:17:05 -08:00
2009-09-24 07:20:57 -07:00
2009-10-01 16:11:13 -07:00
2010-01-04 11:33:58 +01:00
2009-11-18 17:09:26 -05:00
2009-09-04 19:42:22 -04:00
2009-12-15 08:53:20 -08:00
2009-11-04 09:50:58 -08:00
2009-12-14 23:55:33 +01:00
2009-12-15 20:56:42 -08:00
2009-12-14 23:55:33 +01:00
2009-12-14 23:55:32 +01:00
2009-12-14 23:55:33 +01:00
2009-12-15 08:53:26 -08:00
2009-09-15 02:44:17 -07:00
2010-02-01 08:22:32 +01:00
2009-11-13 14:23:11 -08:00
2009-11-23 15:53:52 -05:00
2009-10-30 08:27:25 +11:00
2009-12-17 09:25:19 +11:00
2009-09-15 11:37:33 +10:00
2009-12-16 07:20:10 -08:00
2009-09-24 07:47:35 -04:00
2009-09-19 13:13:19 -07:00
2009-11-04 08:44:54 -08:00
2009-12-04 15:39:55 +01:00
2009-09-19 13:13:30 -07:00
2010-01-06 00:14:32 -08:00
2009-08-28 19:57:33 -04:00
2009-08-28 19:57:30 -04:00
2009-11-02 15:43:20 +09:00
2009-11-30 12:02:53 +09:00
2009-12-16 12:16:49 -05:00
2009-09-24 07:21:01 -07:00
2009-12-02 19:57:15 -08:00
2009-12-11 09:17:02 +01:00
2009-12-01 08:20:31 -08:00
2009-12-11 09:17:02 +01:00
2009-12-16 07:20:04 -08:00
2009-09-28 18:00:48 +02:00
2009-11-18 14:52:25 +01:00
2009-10-13 11:48:32 -07:00
2009-10-29 03:00:06 -07:00
2009-12-16 22:32:29 -05:00
2009-12-14 23:55:33 +01:00
2009-12-14 23:55:33 +01:00
2009-12-14 23:55:32 +01:00
2009-12-14 23:55:32 +01:00
2009-12-14 23:55:32 +01:00
2009-12-14 23:55:33 +01:00
2009-10-26 09:40:30 +01:00
2010-01-14 22:38:09 -05:00
2009-11-17 17:40:33 -08:00
2009-12-15 08:53:16 -08:00
2009-09-16 11:50:05 +02:00
2009-11-15 09:03:10 +01:00
2009-12-30 10:27:04 -05:00
2009-12-25 17:30:22 -08:00
2009-12-23 11:23:43 -08:00
2009-09-18 09:48:52 -07:00
2009-09-01 18:25:07 -07:00
2009-12-02 22:07:25 -08:00
2009-11-13 20:46:24 +01:00
2009-12-16 07:20:00 -08:00
2009-11-13 20:46:24 +01:00
2009-08-30 22:26:34 +02:00
2009-12-08 19:30:19 -08:00
2010-01-21 13:39:03 +01:00
2009-10-29 11:17:40 +11:00
2009-12-09 14:05:49 -05:00
2009-12-16 07:20:08 -08:00
2009-11-26 09:04:55 +01:00
2009-09-15 09:50:47 -07:00
2009-09-27 13:35:16 -07:00
2010-01-16 12:15:38 -08:00
2010-01-07 11:58:36 -06:00
2009-11-20 00:52:05 -08:00
2009-11-10 20:54:38 -08:00
2009-12-11 11:55:26 -08:00
2010-01-20 15:24:35 -08:00
2009-12-10 22:55:37 +01:00
2009-11-29 22:03:04 +01:00
2009-09-23 18:13:10 -07:00
2009-08-26 12:39:29 +01:00
2009-12-12 13:08:15 +01:00
2009-09-24 09:57:08 -07:00
2009-12-16 09:27:16 -02:00
2009-10-22 16:39:28 +10:30
2009-10-22 16:39:28 +10:30
2009-10-22 16:39:30 +10:30
2009-09-23 07:39:29 -07:00
2009-10-22 16:39:28 +10:30
2009-09-23 22:26:32 +09:30
2009-10-22 16:39:28 +10:30
2009-10-22 16:39:28 +10:30
2009-09-23 22:26:31 +09:30
2009-12-15 08:53:16 -08:00
2009-11-13 15:54:27 -08:00
2009-12-17 15:45:30 -08:00
2009-09-15 16:51:30 +02:00
2009-09-04 20:20:58 +04:00
2009-09-23 03:49:27 +04:00
2009-11-16 01:09:48 +09:00
2009-12-23 07:57:07 -05:00
2009-11-18 23:30:41 -08:00
2009-12-16 12:16:49 -05:00
2009-11-25 15:48:37 -08:00