===================================================================
@@ -527,7 +527,13 @@ static RAW_NOTIFIER_HEAD(pvclock_gtod_ch
static void update_pvclock_gtod(struct timekeeper *tk, bool was_set)
{
- raw_notifier_call_chain(&pvclock_gtod_chain, was_set, tk);
+ static struct timekeeper prev_timekeeper;
+
+ /* Only notify if the clocksource has changed.*/
+ if (memcmp(tk, &prev_timekeeper, sizeof(struct timekeeper))) {
+ raw_notifier_call_chain(&pvclock_gtod_chain, was_set, tk);
+ memcpy(&prev_timekeeper, tk, sizeof(struct timekeeper));
+ }
}
/**