Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1376364 > unrolled thread
| Started by | Shaohua Li <shli@fb.com> |
|---|---|
| First post | 2016-04-12 03:00 +0200 |
| Last post | 2016-04-12 03:00 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[RFC 2/2] time: double check if watchdog clocksource is correct Shaohua Li <shli@fb.com> - 2016-04-12 03:00 +0200
| From | Shaohua Li <shli@fb.com> |
|---|---|
| Date | 2016-04-12 03:00 +0200 |
| Subject | [RFC 2/2] time: double check if watchdog clocksource is correct |
| Message-ID | <rmUQq-6Fz-1@gated-at.bofh.it> |
We use watchdog clocksource to detect unstable clocksource. This assumes
watchdog clocksource is correct. But it's possible watchdog clocksource
is crappy, please see previous patch. Double check if watchdog interval
is too long and bypass potential wrong watchdog clocksource.
Signed-off-by: Shaohua Li <shli@fb.com>
---
kernel/time/clocksource.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 56ece14..36aff4e 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -122,9 +122,10 @@ static int clocksource_watchdog_kthread(void *data);
static void __clocksource_change_rating(struct clocksource *cs, int rating);
/*
- * Interval: 0.5sec Threshold: 0.0625s
+ * Interval: 0.5sec, Max Interval: 0.75sec, Threshold: 0.0625s
*/
#define WATCHDOG_INTERVAL (HZ >> 1)
+#define WATCHDOG_MAX_INTERVAL ((NSEC_PER_SEC >> 1) + (NSEC_PER_SEC >> 2))
#define WATCHDOG_THRESHOLD (NSEC_PER_SEC >> 4)
static void clocksource_watchdog_work(struct work_struct *work)
@@ -217,7 +218,8 @@ static void clocksource_watchdog(unsigned long data)
continue;
/* Check the deviation from the watchdog clocksource. */
- if (abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD) {
+ if (abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD &&
+ wd_nsec < WATCHDOG_MAX_INTERVAL) {
pr_warn("timekeeping watchdog on CPU%d: Marking clocksource '%s' as unstable because the skew is too large:\n",
smp_processor_id(), cs->name);
pr_warn(" '%s' wd_now: %llx wd_last: %llx mask: %llx\n",
--
2.8.0.rc2
Back to top | Article view | linux.kernel
csiph-web