WakeSystem= and other timer fixes#6176
Merged
keszybz merged 6 commits intosystemd:masterfrom Jun 23, 2017
Merged
Conversation
…signed() Quite often we just want to subtract two normal usec_t values, hence provide an implementation for that.
…en clocks We use that quite often, let's implement one clean version of it.
…_clock() Let's use the generic clock shifting logic here.
This reworks timer_enter_waiting() in a couple of ways in order to clean it up a bit and fix systemd#5629. Most importantly, we previously we initialized ts_monotonic to either the current time in CLOCK_MONOTONIC or in CLOCK_BOOTTIME, depending on t->wake_system. Then given specific conditions we'd use this time as base for our timers. And afterwards, if t->wake_system was on we'd convetr the resulting value from CLOCK_MONOTONIC to CLOCK_BOOTTIME again — which of course is wrong since we already were in CLOCK_BOOTTIME! This fixes this logic, by using a triple timestamp so that we always have the right base around, and initially only calculate in CLOCK_MONOTONIC and only convert as last step. Conversion between the clocks is now done with the generic usec_shift_clock(), and additions via usec_add() making these calculations a bit safer. Fixes: systemd#5629
…time When debugging time issues its kinda handy to have an easy way to query the three clocks, hence let's just output them at the beginning of test-time.
2 tasks
Member
|
Commit 5/6 is a bit tricky, but looks correct. Looks all good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fix for #5629 and a number of other time related cleanups.