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
Support CLOCK_BOOTTIME #218
Comments
systemd wants CLOCK_BOOTTIME, though it has a fallback: https://github.com/systemd/systemd/blob/04d7ca022843913fba5170c40be07acf2ab5902b/src/basic/time-util.c#L82 It's not immediately clear to me what functionality it loses. |
Is the current behavior of |
The Linux kernel doesn't have the concept of save / restore, so there is no defined "correct" behavior across S/R. I can see arguments for both sides. As is, the clock jump makes operations with a timeout likely to fire immediately upon restore. On the other hand, it may cause some anomalous timing statistics for things that happen to be measured across S/R. |
You're right, but aren't the situations where "it may cause some anomalous timing statistics" supposed to be using CLOCK_BOOTTIME or a real-time clock instead? I'm considering supporting you on that issue, hence the questions :). But I suppose we can assume it to be strictly equivalent to the current CLOCK_MONOTONIC for now as you said, and that is a different topic. |
I believe CLOCK_BOOTTIME is intended to only be an alias to the existing CLOCK_MONOTONIC (i.e. no dedicated kernel timer). This would effectively make this a minimal change. Is there any plan to make the two clocks independents instead? |
Makes CLOCK_BOOTTIME available with * clock_gettime * timerfd_create * clock_gettime vDSO CLOCK_BOOTTIME is implemented as an alias to CLOCK_MONOTONIC. CLOCK_MONOTONIC already keeps track of time across save and restore. This is the closest possible behavior to Linux CLOCK_BOOTIME, as there is no concept of suspend/resume. Updates google#218
Makes CLOCK_BOOTTIME available with * clock_gettime * timerfd_create * clock_gettime vDSO CLOCK_BOOTTIME is implemented as an alias to CLOCK_MONOTONIC. CLOCK_MONOTONIC already keeps track of time across save and restore. This is the closest possible behavior to Linux CLOCK_BOOTIME, as there is no concept of suspend/resume. Updates google#218
Makes CLOCK_BOOTTIME available with * clock_gettime * timerfd_create * clock_gettime vDSO CLOCK_BOOTTIME is implemented as an alias to CLOCK_MONOTONIC. CLOCK_MONOTONIC already keeps track of time across save and restore. This is the closest possible behavior to Linux CLOCK_BOOTIME, as there is no concept of suspend/resume. Updates #218 FUTURE_COPYBARA_INTEGRATE_REVIEW=#450 from Pixep:feature/add-clock-boottime-as-monotonic 2d11fa0 PiperOrigin-RevId: 258819371
Makes CLOCK_BOOTTIME available with * clock_gettime * timerfd_create * clock_gettime vDSO CLOCK_BOOTTIME is implemented as an alias to CLOCK_MONOTONIC. CLOCK_MONOTONIC already keeps track of time across save and restore. This is the closest possible behavior to Linux CLOCK_BOOTIME, as there is no concept of suspend/resume. Updates #218 FUTURE_COPYBARA_INTEGRATE_REVIEW=#450 from Pixep:feature/add-clock-boottime-as-monotonic 2d11fa0 PiperOrigin-RevId: 258819371
We could likely make CLOCK_BOOTTIME equivalent to CLOCK_MONOTONIC, as CLOCK_MONOTONIC already includes time spent not running during save / restore, which is the closest thing we have to "suspend".
gvisor/pkg/sentry/kernel/timekeeper.go
Lines 119 to 129 in 8f46349
The text was updated successfully, but these errors were encountered: