lkml.org 
[lkml]   [2022]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectQuestion about ktime_get_mono_fast_ns() non-monotonic behavior
Hey everyone,

I have a question about ktime_get_mono_fast_ns(), which is used by the
BPF helper bpf_ktime_get_ns() among other use cases. The comment above
this function specifies that there are cases where the observed clock
would not be monotonic.

I had 2 beginner questions:

1) Is there a (rough) bound as to how much the clock can go backwards?
My understanding is that it is bounded by (slope update * delta), but
I don't know what's the bound of either of those (if any).

2) The comment specifies that for a single cpu, the only way for this
behavior to happen is when observing the time in the context of an NMI
that happens during an update.
For observations across different cpus, are the scenarios where the
non-monotonic behavior happens also tied to observing time within NMI
contexts? or is it something that can happen outside of NMI contexts
as well?

Thanks in advance! (and please excuse any dumb/obvious questions :) )

\
 
 \ /
  Last update: 2022-09-26 23:19    [W:1.012 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site