Open Bug 1204823 Opened 11 years ago Updated 2 days ago

TimeStamp::Now() and TimeStamp::NowLoRes() behave differently over computer sleep over platforms

Categories

(Core :: mozglue, defect, P4)

defect
Points:
1

Tracking

()

ASSIGNED
Tracking Status
firefox43 --- affected

People

(Reporter: gfritzsche, Assigned: jstutte)

References

(Depends on 1 open bug, Blocks 3 open bugs)

Details

(Whiteboard: [measurement:client])

Attachments

(1 file, 10 external files, 8 obsolete files)

10.73 KB, text/html
Details
We have TimeStamp::NowLowRes() etc. for monotonic clock usage, as e.g. used by nsITelemetry.msSinceProcessStart(): https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/toolkit/components/telemetry/Telemetry.cpp#3565 However, we noticed that this behaves differently over platforms when a computer goes to sleep, so it's not useful for any cross-platform time measurements. On Windows this comes down to GetTickCount64(), which does increase over sleep periods: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724411%28v=vs.85%29.aspx https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/mozglue/misc/TimeStamp_windows.cpp#530 OS X comes down to mach_absolute_time(), which does not increase over sleep periods: https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/mozglue/misc/TimeStamp_darwin.cpp#49 POSIX comes down to clock_gettime(CLOCK_MONOTONIC, &ts), which should not increase over sleep time either: https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/mozglue/misc/TimeStamp_posix.cpp#77
Whiteboard: [unifiedTelemetry]
Priority: -- → P2
Benjamin, do you have an opinion on the expected behavior here or know who might have one? I'm leaning towards the Windows behavior of actual time elapsed, not "time spent in working state".
Flags: needinfo?(benjamin)
I don't have an opinion. You'd need to survey existing callers to figure out whether they expect one thing or the other. Nathan may know more. But rather than asking about TimeStamp specifically, can you just articulate the behavior you actually want and we can decide where that implementation should live?
Flags: needinfo?(benjamin) → needinfo?(nfroyd)
(In reply to Benjamin Smedberg [:bsmedberg] from comment #2) > But rather than asking about TimeStamp specifically, can you just articulate > the behavior you actually want and we can decide where that implementation > should live? There are two issues here: * the TimeStamp implementation behaves inconsistent across platforms * what behavior our affected use should have (moving that needinfo to another bug)
(In reply to Georg Fritzsche [:gfritzsche] [away Sep 5 - 13] from comment #3) > * the TimeStamp implementation behaves inconsistent across platforms Is this true for high resolution timing as well? I can't tell straightaway from reading the Windows code. I can see arguments both ways for what people prefer. For telemetry measurements, I think you'd typically want actual time spent working. But I'm not entirely sure about that--would have to think about it a little more. The answer might depend on the particular measurement, too...
Flags: needinfo?(nfroyd)
From a casual check on DXR, TimeStamp seems to be used both ways: (1) for checking how long some operation takes (including sleep time probably undesired) (2) for checking how much time passed since a certain event (sleep time should probably be included) I'm thinking defaulting to including sleep time might be the safer approach with less issues triggered. Giving that is the effective behavior on Windows, features should already work ok with that. E.g. the slow script detection works around sleep time jumps somewhat awkwardly: https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/js/xpconnect/src/XPCJSRuntime.cpp#1345
Blocks: 1205567
(In reply to Nathan Froyd [:froydnj] from comment #4) > (In reply to Georg Fritzsche [:gfritzsche] [away Sep 5 - 13] from comment #3) > > * the TimeStamp implementation behaves inconsistent across platforms > > Is this true for high resolution timing as well? I can't tell straightaway > from reading the Windows code. From this: http://www.janbambas.cz/usage-of-queryperformancecounter-in-gecko/ ... and a quick look over this: https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/mozglue/misc/TimeStamp_windows.cpp#317 ... my understanding is that high-resolution timing on Windows should just fall back to GetTickCount64() values after sleep periods and thus behave the same. Honza, can you confirm?
Flags: needinfo?(honzab.moz)
Points: --- → 1
Whiteboard: [unifiedTelemetry] → [unifiedTelemetry][measurement:client]
Priority: P2 → P1
>... my understanding is that high-resolution timing on Windows should just fall > back to GetTickCount64() values after sleep periods Yes, the mechanism is described in my blog post. It's rather complicated and we often work with "difference of a difference". But gives good results. > and thus behave the same Yes. If you use NowLoRes(), it always only works with GTC which (AFAIK) reflects the sleep time as "working time". I don't see any problem with NowLoRes() on win according sleep. On Windows, I'm not sure which of the timers [1] is "stopped" during sleep/hibernation. I would have to check on all of them. Also, it can differ from hardware to hardware (as QPC does). The problem with sleep, GetTickCount and QueryPerformanceCoounter is that they perceive the sleep period time differently. But when you are using NowLoRes() you don't need to worry ;) It only uses GTC. Also, the implementation as is ensures "monotonicity" and constant "calibration" according to GTC values. GTC is considered (also according my findings) a very stable timer, tho with low usually 15.6ms resolution. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=676349#c0
Flags: needinfo?(honzab.moz)
Nathan, what do you think? Do you think staying consistently with incrementing over sleep times sounds reasonable, given the last 3 comments? The approach chosen here affects how we solve this in Telemetry.
Flags: needinfo?(nfroyd)
(In reply to Georg Fritzsche [:gfritzsche] from comment #8) > Nathan, what do you think? > Do you think staying consistently with incrementing over sleep times sounds > reasonable, given the last 3 comments? > > The approach chosen here affects how we solve this in Telemetry. Is it possible to address this in telemetry by always explicitly separating out things by platform (on the server/dashboard side) or by applying some sort of compensation for time spent asleep (possibly recorded in a separate histogram)? It's a good point that things already work this way on Windows *ought* to make changing it on other platforms work out just fine. But I'm a little leery of the consequences; support for monotonic suspend-aware clocks on Linux is not universal (>= 2.6.39, according to the manpage, which may not be reliable; I don't know how our kernel version and/or kernel support for this on Android looks), and it's certainly not portable across POSIX platforms. Mac seems to have support for this, though: http://stackoverflow.com/questions/12488481/getting-ios-system-uptime-that-doesnt-pause-when-asleep/12490414#12490414 Also worth noting that somebody was at least thinking about suspend when they wrote the TimeStamp code: http://mxr.mozilla.org/mozilla-central/source/mozglue/misc/TimeStamp.h#363 whether or not all the users of TimeStamp were aware of that is another question... I am cautiously in favor, but I'd like to know if there are other alternatives we can pursue first.
Flags: needinfo?(nfroyd)
(In reply to Nathan Froyd [:froydnj] from comment #9) > (In reply to Georg Fritzsche [:gfritzsche] from comment #8) > > Nathan, what do you think? > > Do you think staying consistently with incrementing over sleep times sounds > > reasonable, given the last 3 comments? > > > > The approach chosen here affects how we solve this in Telemetry. > > Is it possible to address this in telemetry by always explicitly separating > out things by platform (on the server/dashboard side) or by applying some > sort of compensation for time spent asleep (possibly recorded in a separate > histogram)? We have a chance to submit proper values now and we want to specifically measure time including sleep (and later also time excluding sleep etc.). So we should fix i now and avoid accumulating weird server-side special cases. If the decision for this bug is that it's ok for `TimeStamp`, then i will implement something specifically for Telemetry that gives us what we need - i just need to know :) > It's a good point that things already work this way on Windows *ought* to > make changing it on other platforms work out just fine. But I'm a little > leery of the consequences; support for monotonic suspend-aware clocks on > Linux is not universal (>= 2.6.39, according to the manpage, which may not > be reliable; I don't know how our kernel version and/or kernel support for > this on Android looks), and it's certainly not portable across POSIX > platforms. Mac seems to have support for this, though: > http://stackoverflow.com/questions/12488481/getting-ios-system-uptime-that- > doesnt-pause-when-asleep/12490414#12490414 Ok, so Linux/Android are the problematic parts. Do we have anyone with good knowledge there we could ping?
Flags: needinfo?(nfroyd)
(In reply to Georg Fritzsche [:gfritzsche] from comment #10) > (In reply to Nathan Froyd [:froydnj] from comment #9) > > (In reply to Georg Fritzsche [:gfritzsche] from comment #8) > > > Nathan, what do you think? > > > Do you think staying consistently with incrementing over sleep times sounds > > > reasonable, given the last 3 comments? > > > > > > The approach chosen here affects how we solve this in Telemetry. > > > > Is it possible to address this in telemetry by always explicitly separating > > out things by platform (on the server/dashboard side) or by applying some > > sort of compensation for time spent asleep (possibly recorded in a separate > > histogram)? > > We have a chance to submit proper values now and we want to specifically > measure time including sleep (and later also time excluding sleep etc.). So > we should fix i now and avoid accumulating weird server-side special cases. > If the decision for this bug is that it's ok for `TimeStamp`, then i will > implement something specifically for Telemetry that gives us what we need - > i just need to know :) You want to measure time including and excluding sleep for everything? This paragraph confuses me. Did you mean "...is that it's *not* ok for TimeStamp"? > > It's a good point that things already work this way on Windows *ought* to > > make changing it on other platforms work out just fine. But I'm a little > > leery of the consequences; support for monotonic suspend-aware clocks on > > Linux is not universal (>= 2.6.39, according to the manpage, which may not > > be reliable; I don't know how our kernel version and/or kernel support for > > this on Android looks), and it's certainly not portable across POSIX > > platforms. Mac seems to have support for this, though: > > http://stackoverflow.com/questions/12488481/getting-ios-system-uptime-that- > > doesnt-pause-when-asleep/12490414#12490414 > > Ok, so Linux/Android are the problematic parts. Do we have anyone with good > knowledge there we could ping? I don't know if we have minimum kernel versions required for either Linux or Android, or whether our minimum required Android version implies a minimum kernel version. Maybe :snorp would know more about the Android situation?
Flags: needinfo?(nfroyd) → needinfo?(snorp)
Oh, :jld might know something about our Linux kernel support, since he's groveled around in places that care about that. Jed, see comment 11?
Flags: needinfo?(jld)
(In reply to Nathan Froyd [:froydnj] from comment #11) > (In reply to Georg Fritzsche [:gfritzsche] from comment #10) > > (In reply to Nathan Froyd [:froydnj] from comment #9) > > > (In reply to Georg Fritzsche [:gfritzsche] from comment #8) > > > > Nathan, what do you think? > > > > Do you think staying consistently with incrementing over sleep times sounds > > > > reasonable, given the last 3 comments? > > > > > > > > The approach chosen here affects how we solve this in Telemetry. > > > > > > Is it possible to address this in telemetry by always explicitly separating > > > out things by platform (on the server/dashboard side) or by applying some > > > sort of compensation for time spent asleep (possibly recorded in a separate > > > histogram)? > > > > We have a chance to submit proper values now and we want to specifically > > measure time including sleep (and later also time excluding sleep etc.). So > > we should fix i now and avoid accumulating weird server-side special cases. > > If the decision for this bug is that it's ok for `TimeStamp`, then i will > > implement something specifically for Telemetry that gives us what we need - > > i just need to know :) > > You want to measure time including and excluding sleep for everything? Yes - starting with excluding sleep here. Browser activity/usage/... times are very important to our analysis needs and we need consistent data here. > This paragraph confuses me. Did you mean "...is that it's *not* ok for > TimeStamp"? I mean, if the decision here is to leave TimeStamp as is, then i will move on. I just need to know either way, the current situation doesn't work for us.
One thing I know is that B2G ICS emulator is 2.6.29 but all the physical B2G ICS devices are 3.0.x. I'm a little fuzzy on the larger Android ecosystem (specifically, I'm not sure if Android ICS shipped 2.6.29 on actual devices or just the emulator), but we still support Gingerbread for Fennec so I don't think we can require 2.6.39 there. But... if I understand correctly, Android/B2G devices don't actually sleep like that, so if that's the case they could just use CLOCK_MONOTONIC. On desktop, we support (and build on!) CentOS 6, which is on a kernel that calls itself 2.6.32 but has a lot of patches; I don't know offhand whether it has CLOCK_BOOTTIME. If some kind of graceful degradation is possible and we're wondering what percentage of desktop Linux would be affected, FHR would have data on that but I'm pretty sure it's <5%. Also maybe useful to know: Linux desktop automated tests other than gtests currently run on 3.2 (gtests run on the build host), and all tests will run on 3.13 kernels under TaskCluster. This may have implications for test coverage.
Flags: needinfo?(jld)
kicked to p2 until we can pack into a sprint (likely next)
Priority: P1 → P2
As Jed said, the Android minimum kernel is pretty low. Eugen did some work around this recently, though, so maybe he has some more insight.
Flags: needinfo?(snorp) → needinfo?(esawin)
Android 3 (Honeycomb) is based on 2.6.36, Android 4 (ICS) on 3.0.1 [1]. If monotonicity is not a hard requirement, then you could use CPU time [2] instead, which should give consistent results including "sleep times" across platforms. [1] https://en.wikipedia.org/wiki/Android_version_history [2] bug 1193821
Flags: needinfo?(esawin)
Priority: P2 → P3
Whiteboard: [unifiedTelemetry][measurement:client] → [measurement:client]
Priority: P3 → P4
Blocks: 1359403
One thing I came across while investigating bug 1359403 relating to this is that if TimeStamp *were* to use CLOCK_BOOTTIME on Linux, the sleeping code that the timer thread uses is based on CLOCK_MONOTONIC (via pthreads), and it doesn't appear that that code can use CLOCK_BOOTTIME. That code would likely need to use different code for sleeping. Also, CLOCK_BOOTTIME came out in Linux 2.6.39, which came out about 7 years ago now - are Android kernels still that far behind?
See Also: → 1485692

TimeStamp::NowLoRes now always returns timestamps that increment during the
device is suspended.

Depends on D98317

Attachment #9190615 - Attachment is obsolete: true
Severity: normal → S3
Blocks: 1834683
Summary: TimeStamp::NowLowRes() behaves differently over computer sleep over platforms → TimeStamp::Now() and TimeStamp::NowLoRes() behave differently over computer sleep over platforms
See Also: → 1709767
See Also: → 2089250, 2074047, 282013
Duplicate of this bug: 282013

I'd like to revive this, as it keeps showing up in different disguises (bug 2089250, bug 2074047, bug 1834683, bug 1709767). Current state:

AwakeTimeStamp gives us a consistent "awake only" clock on all platforms, but TimeStamp remains "whatever the platform does". The most visible consequence is that nsITimer deadlines are based on TimeStamp::Now() and TimerThread::DoAfterSleep only re-scans the pending timers: on Windows, timers that became due during sleep fire on wake, on macOS and Linux every pending timer is pushed out by the sleep duration. ScheduledTask and now the update badge in bug 2089250 work around this with Date.now(), and every other long-running timer has the same problem. The same applies to TimeStamp-based expirations like DNS TTLs, the CORS preflight cache or HTTP cache validity, which live longer by the sleep duration on macOS and Linux.

History: bug 1178890 briefly shifted all pending timers by the time slept on wake, which bug 1197152 removed again because timers created between resume and the wake notification got shifted too. The behaviour chosen there (bug 1197152 comment 47) is that delays are absolute and overdue timers fire on resume, but that only holds where TimeStamp counts sleep, i.e. on Windows. The timer storm on wake that motivated the original adjustment in bug 197863 was most likely the old TYPE_REPEATING_PRECISE catching up on missed ticks; that type is now an alias of TYPE_REPEATING_PRECISE_CAN_SKIP (bug 1190735).

Proposal: make TimeStamp count sleep on all platforms, as it already does on Windows, and use AwakeTimeStamp where awake time is what we want.

  1. Make NowLoRes() an alias of Now() everywhere. It already is on Windows and macOS; only Linux/Android still use CLOCK_MONOTONIC_COARSE. None of the ~115 callers needs the coarse resolution as such: they are TTLs, timeouts, rate limits and millisecond-level telemetry, and the hottest one (the socket transport poll loop) is dominated by the poll() syscall. Removing NowLoRes() can then be a mechanical follow-up.
  2. Move the callers that want awake time to AwakeTimeStamp. Known candidates are the event page idle timeout (bug 1834683) and the AsyncShutdown countdown (already done in bug 2074047). Given that Windows has been counting sleep for years, I expect this list to stay short.
  3. Switch macOS to mach_continuous_time and Linux/Android to CLOCK_BOOTTIME, Nightly first. The minimum OS versions that were a concern in 2015 are long below what we support.
  4. Remove the Date.now() workarounds in ScheduledTask and the update listener.

Open questions:

  • Cost of CLOCK_BOOTTIME on Linux and Android: there is no coarse variant, and we need to check that it is served by the vDSO on all kernels and architectures we support. This needs a microbenchmark before anything else.
  • pthread_cond_timedwait with CLOCK_MONOTONIC does not expire during suspend, so timely timer firing after wake still relies on wake_notification arriving, which we need to verify on Linux and Android.
  • Rust's std::time::Instant uses the same platform clocks as TimeStamp today and would diverge after a sleep on macOS and Linux. We need to check whether anything compares the two.
  • performance.now() and rAF timestamps share a timeline per spec, while CSS animations should not tick during suspend (bug 1709767 comment 16). Bug 1709767 needs its own decision on that, independent of the timer fix here.
See Also: → 1197152
Attached file bug1204823-sleep-test.html —

The page checks whether Firefox's clocks and timers count time spent in system sleep (suspend).

  1. Open the page as a local file in the Firefox build you want to test, ideally with a fresh profile:
    firefox -no-remote -profile "$(mktemp -d)" file:///path/to/bug1204823-sleep-test.html
  2. Keep the tab in the foreground and click "Arm". This starts a timer that is due 3 minutes later, a 1 s interval and a long animation.
  3. Within 3 minutes, suspend the machine (systemctl suspend, closing the lid, or on Linux sudo rtcwake -m mem -s 600, which wakes it by itself after 10 minutes). Don't start the sleep with less than 15 s left on the timer.
  4. Stay asleep for at least 6 minutes; 10 is better.
  5. Wake and unlock the machine, bring the tab to the front, click "Check", then press any key (for the keydown check).
  6. Click "Copy results" and save the JSON.

Rows in the results:

  • Timer due during sleep: should fire within 5 s of wake. Old behaviour: it fires after the awake time that was left.
  • performance.now() vs Date.now(): should agree to within 2 s. Old behaviour: performance.now() is behind by the sleep time.
  • Interval across sleep: the performance.now() gap should match the wall-clock gap. Old behaviour: about 1 s.
  • Animation across sleep: should be finished. Old behaviour: still running.
  • Click / keydown event timeStamp and requestAnimationFrame: should pass on both old and new builds. A failure with an offset about the size of the sleep means old and new clocks are being mixed.

INCONCLUSIVE means the run didn't set up the case (timer fired before the sleep, sleep too short, or too little time left on the timer). Repeat the run.
If an unpatched build passes the first four rows, the machine probably didn't really suspend. On Linux, check with: journalctl -b | grep -i suspend

AwakeTimeStamp gains FromMicroseconds, FromTruncatedMilliseconds and
ToTimeStamp, for timestamps that the system reports on its awake clock.
ToTimeStamp keeps the difference between the two clocks until a measurement
proves that it changed, so that converted timestamps keep their order.

NSEvent timestamps and CVDisplayLink host times are on the awake clock, which
TimeStamp also uses today. Convert them through AwakeTimeStamp instead of
TimeStamp::FromSystemTime, so that they stay correct once TimeStamp counts
system sleep. No behaviour change.

Android event times and Choreographer frame times are on CLOCK_MONOTONIC,
which TimeStamp also uses today. Convert them through AwakeTimeStamp instead of
TimeStamp::FromSystemTime, so that they stay correct once TimeStamp counts
system sleep. No behaviour change.

Wayland compositors report event and frame callback times in milliseconds of
CLOCK_MONOTONIC, truncated to 32 bits, which TimeStamp also uses today. Convert
them through AwakeTimeStamp instead of TimeStamp::FromSystemTime, so that they
stay correct once TimeStamp counts system sleep.

No behaviour change, except that truncated times are now unwrapped correctly
after 49.7 days of uptime or when slightly ahead of now.

It assumes that system timestamps are on the same clock as TimeStamp, which
stops being true once TimeStamp counts system sleep. It has no users left.

Once TimeStamp counts sleep, the timer thread, which waits on a clock that
does not, needs the wake notification to recompute its wait. Only sleep
notifications stay ignored on macOS, as they may come without a matching
wake notification. The pref is renamed to match its narrower meaning.

The X server time does not advance during sleep. Once TimeStamp counts
sleep, the converter would place events after a wake in the past by the
sleep duration until its skew correction catches up. Converting on a
timeline that follows the awake clock avoids that, and the result is moved
onto the TimeStamp timeline.

The hidden window check runs on a GLib timer, which does not advance during
sleep. Once TimeStamp counts sleep, the window would be reported as occluded
once after a wake and the vsync rate estimate would be disturbed. Frame
callback times are on the awake clock too.

The following patches forward wake_notification to child processes. The
network change and captive portal recheck it triggers in nsIOService are
parent-only work, and the parent already forwards the link change to content
processes.

Once TimeStamp counts sleep, timers that became due during sleep only fire
promptly after wake when the timer thread gets wake_notification, which so
far only the parent process receives.

Content processes now also skip input event telemetry for events from before
the wake, as the parent already does.

Its timer thread waits on a clock that does not advance during sleep, so like
content processes it needs the wake notification to fire timers that became
due while the system was asleep.

Its timer thread waits on a clock that does not advance during sleep, so like
content processes it needs the wake notification to fire timers that became
due while the system was asleep.

Their timer threads wait on a clock that does not advance during sleep, so
like content processes they need the wake notification to fire timers that
became due while the system was asleep.

Android has no system wake notification, and the device usually sleeps while
Firefox is in the background. So the timer thread handles
application-foreground like wake_notification, and the parent forwards it to
the GPU, RDD and utility processes as a wake. Content processes already get
application-foreground.

TimeStamp already counts sleep on Windows (QueryPerformanceCounter). Switch
macOS to mach_continuous_time and Linux/Android to CLOCK_BOOTTIME so that
deadlines and expirations behave the same everywhere. NowLoRes() becomes the
same as Now().

The raw clock getters used to align with external tools keep returning values
on the awake timelines.

Telemetry session lengths now include sleep on macOS and Linux, as they
already do on Windows.

MOZ_TIMESTAMP_SIMULATED_SLEEP_S=<seconds> makes TimeStamp behave as if the
system had slept that long since boot, so code that still mixes it with the
awake clock is off by that amount.

On Android the environment is set up by Java after mozglue has started, so the
variable is read again once that is done and the startup timestamps taken
before are shifted. The gtest and junit harnesses forward it to the device.

Timers that became due during sleep now fire on wake on all platforms, so the
scheduler tick no longer needs the wake notification to run.

Assignee: nobody → jstutte
Status: NEW → ASSIGNED
Depends on: 2090731

Comment on attachment 9676247 [details]
WIP: Bug 1204823 Part 6 - Handle wake notifications in TimerThread on macOS. r?#xpcom-reviewers

Revision D340442 was moved to bug 2090731. Setting attachment 9676247 [details] to obsolete.

Attachment #9676247 - Attachment is obsolete: true

Comment on attachment 9676250 [details]
WIP: Bug 1204823 Part 9 - Only handle wake_notification in the parent's nsIOService. r?#necko-reviewers

Revision D340445 was moved to bug 2090731. Setting attachment 9676250 [details] to obsolete.

Attachment #9676250 - Attachment is obsolete: true

Comment on attachment 9676251 [details]
WIP: Bug 1204823 Part 10 - Forward wake_notification to content processes. r?#dom-reviewers

Revision D340446 was moved to bug 2090731. Setting attachment 9676251 [details] to obsolete.

Attachment #9676251 - Attachment is obsolete: true

Comment on attachment 9676252 [details]
WIP: Bug 1204823 Part 11 - Forward wake_notification to the GPU process. r?#gfx-reviewers

Revision D340447 was moved to bug 2090731. Setting attachment 9676252 [details] to obsolete.

Attachment #9676252 - Attachment is obsolete: true

Comment on attachment 9676253 [details]
WIP: Bug 1204823 Part 12 - Forward wake_notification to the RDD process. r?#media-playback-reviewers

Revision D340448 was moved to bug 2090731. Setting attachment 9676253 [details] to obsolete.

Attachment #9676253 - Attachment is obsolete: true

Comment on attachment 9676254 [details]
WIP: Bug 1204823 Part 13 - Forward wake_notification to utility processes. r?#ipc-reviewers

Revision D340449 was moved to bug 2090731. Setting attachment 9676254 [details] to obsolete.

Attachment #9676254 - Attachment is obsolete: true

Comment on attachment 9676255 [details]
WIP: Bug 1204823 Part 14 - Treat returning to the foreground as a wake on Android. r?#xpcom-reviewers,#geckoview-reviewers

Revision D340450 was moved to bug 2090731. Setting attachment 9676255 [details] to obsolete.

Attachment #9676255 - Attachment is obsolete: true
Attachment #9676248 - Attachment description: WIP: Bug 1204823 Part 7 - Convert X11 event times on the awake clock. r?#gtk-reviewers → WIP: Bug 1204823 Part 6 - Convert X11 event times on the awake clock. r?#gtk-reviewers
Attachment #9676249 - Attachment description: WIP: Bug 1204823 Part 8 - Track the last Wayland vsync on the awake clock. r?#gtk-reviewers → WIP: Bug 1204823 Part 7 - Track the last Wayland vsync on the awake clock. r?#gtk-reviewers
Attachment #9676256 - Attachment description: WIP: Bug 1204823 Part 15 - Make TimeStamp count system sleep on macOS, Linux and Android. r?#xpcom-reviewers,#toolkit-telemetry-reviewers-rotation → WIP: Bug 1204823 Part 8 - Make TimeStamp count system sleep on macOS, Linux and Android. r?#xpcom-reviewers,#toolkit-telemetry-reviewers-rotation
Attachment #9676257 - Attachment description: WIP: Bug 1204823 Part 16 - Add MOZ_TIMESTAMP_SIMULATED_SLEEP_S to find code that mixes TimeStamp and AwakeTimeStamp. r?#xpcom-reviewers,#geckoview-reviewers → WIP: Bug 1204823 Part 9 - Add MOZ_TIMESTAMP_SIMULATED_SLEEP_S to find code that mixes TimeStamp and AwakeTimeStamp. r?#xpcom-reviewers,#geckoview-reviewers
Attachment #9676258 - Attachment description: WIP: Bug 1204823 Part 17 - Remove the wake_notification handler from TelemetryScheduler. r?#toolkit-telemetry-reviewers-rotation → WIP: Bug 1204823 Part 10 - Remove the wake_notification handler from TelemetryScheduler. r?#toolkit-telemetry-reviewers-rotation
Attachment #9676242 - Attachment description: WIP: Bug 1204823 Part 1 - Add conversions from the system's awake clock to AwakeTimeStamp. r?#xpcom-reviewers → WIP: Bug 1204823 Part 1 - Add a converter from the system's awake clock to TimeStamp. r?#xpcom-reviewers
Attachment #9676243 - Attachment description: WIP: Bug 1204823 Part 2 - Convert macOS event and vsync times through AwakeTimeStamp. r?#mac-reviewers → WIP: Bug 1204823 Part 2 - Convert macOS event and vsync times with AwakeClockConverter. r?#mac-reviewers
Attachment #9676244 - Attachment description: WIP: Bug 1204823 Part 3 - Convert Android event and vsync times through AwakeTimeStamp. r?#geckoview-reviewers → WIP: Bug 1204823 Part 3 - Convert Android event and vsync times with AwakeClockConverter. r?#geckoview-reviewers
Attachment #9676245 - Attachment description: WIP: Bug 1204823 Part 4 - Convert Wayland event and vsync times through AwakeTimeStamp. r?#gtk-reviewers → WIP: Bug 1204823 Part 4 - Convert Wayland event and vsync times with AwakeClockConverter. r?#gtk-reviewers
Attachment #9676242 - Attachment description: WIP: Bug 1204823 Part 1 - Add a converter from the system's awake clock to TimeStamp. r?#xpcom-reviewers → Bug 1204823 Part 1 - Add a converter from the system's awake clock to TimeStamp. r?#xpcom-reviewers!,#mac-reviewers,#gtk-reviewers,#geckoview-reviewers
Attachment #9676243 - Attachment description: WIP: Bug 1204823 Part 2 - Convert macOS event and vsync times with AwakeClockConverter. r?#mac-reviewers → Bug 1204823 Part 2 - Convert macOS event and vsync times with AwakeClockConverter. r?#mac-reviewers
Attachment #9676244 - Attachment description: WIP: Bug 1204823 Part 3 - Convert Android event and vsync times with AwakeClockConverter. r?#geckoview-reviewers → Bug 1204823 Part 3 - Convert Android event and vsync times with AwakeClockConverter. r?#geckoview-reviewers
Attachment #9676245 - Attachment description: WIP: Bug 1204823 Part 4 - Convert Wayland event and vsync times with AwakeClockConverter. r?#gtk-reviewers → Bug 1204823 Part 4 - Convert Wayland event and vsync times with AwakeClockConverter. r?#gtk-reviewers
Attachment #9676246 - Attachment description: WIP: Bug 1204823 Part 5 - Remove TimeStamp::FromSystemTime. r?#xpcom-reviewers → Bug 1204823 Part 5 - Remove TimeStamp::FromSystemTime. r?#xpcom-reviewers
Attachment #9676248 - Attachment description: WIP: Bug 1204823 Part 6 - Convert X11 event times on the awake clock. r?#gtk-reviewers → Bug 1204823 Part 6 - Convert X11 event times on the awake clock. r?#gtk-reviewers
Attachment #9676249 - Attachment description: WIP: Bug 1204823 Part 7 - Track the last Wayland vsync on the awake clock. r?#gtk-reviewers → Bug 1204823 Part 7 - Track the last Wayland vsync on the awake clock. r?#gtk-reviewers
Attachment #9676256 - Attachment description: WIP: Bug 1204823 Part 8 - Make TimeStamp count system sleep on macOS, Linux and Android. r?#xpcom-reviewers,#toolkit-telemetry-reviewers-rotation → Bug 1204823 Part 8 - Make TimeStamp count system sleep on macOS, Linux and Android. r?#xpcom-reviewers,#toolkit-telemetry-reviewers-rotation
Attachment #9676258 - Attachment description: WIP: Bug 1204823 Part 10 - Remove the wake_notification handler from TelemetryScheduler. r?#toolkit-telemetry-reviewers-rotation → Bug 1204823 Part 10 - Remove the wake_notification handler from TelemetryScheduler. r?#toolkit-telemetry-reviewers-rotation
Attachment #9676257 - Attachment description: WIP: Bug 1204823 Part 9 - Add MOZ_TIMESTAMP_SIMULATED_SLEEP_S to find code that mixes TimeStamp and AwakeTimeStamp. r?#xpcom-reviewers,#geckoview-reviewers → Bug 1204823 Part 9 - Add MOZ_TIMESTAMP_SIMULATED_SLEEP_S to find code that mixes TimeStamp and AwakeTimeStamp. r?#xpcom-reviewers,#geckoview-reviewers

The behavior of TimeStamp currently directly influences also the web observable behavior of DOM timeouts (and performance.now()). The current inconsistency across systems is the same for Firefox and Chrome, currently, see https://github.com/whatwg/html/issues/6759.

As Windows is the outlier, we may want to advocate to do the same there as on other OS, that is ignore sleeping time and just resume as if no time had passed. This means that some consumers should just not use nsITimer when they really want wall clock alarms (and we may need a mechanism for those, too).

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: