]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - kernel/time/timekeeping.c
nohz: Prevent clocksource wrapping during idle
[mirror_ubuntu-zesty-kernel.git] / kernel / time / timekeeping.c
index 96b3f0dfa5dcdfb2d746d2a0c66c92620b605c46..5d4d4239a0aa5871b0bd9f08b5774c9197c9d625 100644 (file)
@@ -477,6 +477,17 @@ int timekeeping_valid_for_hres(void)
        return ret;
 }
 
+/**
+ * timekeeping_max_deferment - Returns max time the clocksource can be deferred
+ *
+ * Caller must observe xtime_lock via read_seqbegin/read_seqretry to
+ * ensure that the clocksource does not change!
+ */
+u64 timekeeping_max_deferment(void)
+{
+       return timekeeper.clock->max_idle_ns;
+}
+
 /**
  * read_persistent_clock -  Return time from the persistent clock.
  *