-
Notifications
You must be signed in to change notification settings - Fork 13.4k
time.rs should consider using CLOCK_MONOTONIC_RAW instead of CLOCK_MONOTONIC on Linux #37902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We can't unconditionally use RAW since we support Linux all the way back to 2.6.18. We can probably use it when supported though. |
This is definitely a kernel bug: We probably don't want to use |
Yes |
It seems that we want to use |
Is this documented or tested anywhere ? |
Uh oh!
There was an error while loading. Please reload this page.
I have reproducible compiler crashes on arm64:
I'm not really sure where that behavior originates but I suspect the rather old Kernel in combination with the (obscure) hardware I'm running. longsleep/linux-pine64#44 has some more details, basically I see CLOCK_MONOTONIC jumping backwards from time to time. Looking somehow further I see other people used to have the same issue (http://stackoverflow.com/questions/3657289/linux-clock-gettimeclock-monotonic-strange-non-monotonic-behavior)
My Linux Kernel docs say:
I see this behavior even without OpenNTPd running (so I still suspect that there is a Kernel/HW-Issue), but it might be better to use the Linux specific RAW version of the monotonic clock in order to get strict monotonic increasing values.
I just saw #37137 but as this is on real hardware that might be more relevant. Even when I'm not running anything that obviously does clock adjustments I see this behavior, RAW seems to be very consistently monotonically increasing. As rust is the only thing that I saw complaining so far you maybe want to consider changing this call.
The text was updated successfully, but these errors were encountered: