Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Issue 446203002: Initialize the now_funciton to the HighResNowWrapper in case High Res is supported (Closed)

Created:
6 years, 4 months ago by fmeawad
Modified:
6 years, 3 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, tonyg, brianderson, cpu_(ooo_6.6-7.5)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

We have noticed a clock shift when QPC was deployed. It shows as a regression on the perf bots https://chromeperf.appspot.com/report?masters=ChromiumPerf&bots=chromium-rel-win8-dual&tests=startup.warm.dirty.blank_page%2Fwindow_display_time&rev=286928 It is not a real regression, the initial_time and initial_ticks are not properly initialized when switching to HighResolution (i.e. QPC). This CL initializes the now_function to the HighResNowWrapper instead of setting it to RolloverProtectedNow then to the HighResNowWrapper. By doing that, we avoid getting an incorrect initial_time and initial_ticks using the RolloverProtectedNow and avoid having to reinitialize. BUG=158234 Committed: https://crrev.com/05399593156ef3b8d96933258cd32fe716f63461 Cr-Commit-Position: refs/heads/master@{#291974}

Patch Set 1 #

Patch Set 2 : Initialize early, instead of initializing per call #

Patch Set 3 : Remove added NowFromSystemTime #

Total comments: 10

Patch Set 4 : Add thread safety to InitializeClock #

Total comments: 2

Patch Set 5 : Adding a comment to explain the global lock #

Total comments: 3

Patch Set 6 : Enable HiRes by default instead of using LowRes then switching to it. #

Total comments: 2

Patch Set 7 : nit fixes #

Total comments: 2

Patch Set 8 : Remove the now_function static Initializer #

Unified diffs Side-by-side diffs Delta from patch set Stats (+29 lines, -42 lines) Patch
M base/test/test_suite.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M base/time/time.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -8 lines 0 comments Download
M base/time/time_win.cc View 1 2 3 4 5 6 7 5 chunks +29 lines, -30 lines 0 comments Download
M chrome/browser/chrome_browser_main_win.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
M content/app/content_main_runner.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
fmeawad
After the switch to QPC, several performance graphs regressed, forcing the initialization seems to fix ...
6 years, 4 months ago (2014-08-07 00:18:33 UTC) #1
fmeawad
Hi Will, Can you PTAL? thanks.
6 years, 4 months ago (2014-08-07 20:07:18 UTC) #2
willchan no longer on Chromium
Sending to jar@. If jar@ approves, TBR to me.
6 years, 4 months ago (2014-08-07 20:12:00 UTC) #3
jar (doing other things)
There are a lot of seemingly racy actions here, and considering the precision that is ...
6 years, 4 months ago (2014-08-08 00:30:53 UTC) #4
fmeawad
(last patch also includes a rebase). Hi Jar, I have addressed your issues. I have ...
6 years, 4 months ago (2014-08-15 00:38:03 UTC) #5
jar (doing other things)
Please add a note to the description of the fix that indicates that we need ...
6 years, 4 months ago (2014-08-15 17:40:39 UTC) #6
fmeawad
Hi Jim, Thank you for the prompt review. I have updated the description. Concerning the ...
6 years, 4 months ago (2014-08-15 21:50:50 UTC) #7
jar (doing other things)
On 2014/08/15 21:50:50, fmeawad-cr wrote: > Hi Jim, > > Thank you for the prompt ...
6 years, 4 months ago (2014-08-15 22:28:01 UTC) #8
willchan no longer on Chromium
+maruel, +thakis I'm disappointed by the additional static initializer, but I see there are tradeoffs ...
6 years, 4 months ago (2014-08-15 22:37:03 UTC) #9
Nico
https://codereview.chromium.org/446203002/diff/80001/base/time/time_win.cc File base/time/time_win.cc (right): https://codereview.chromium.org/446203002/diff/80001/base/time/time_win.cc#newcode90 base/time/time_win.cc:90: // code is low-level, and we don't want to ...
6 years, 4 months ago (2014-08-15 23:17:38 UTC) #10
willchan no longer on Chromium
https://codereview.chromium.org/446203002/diff/80001/base/time/time_win.cc File base/time/time_win.cc (right): https://codereview.chromium.org/446203002/diff/80001/base/time/time_win.cc#newcode90 base/time/time_win.cc:90: // code is low-level, and we don't want to ...
6 years, 4 months ago (2014-08-15 23:20:19 UTC) #11
Nico
On Fri, Aug 15, 2014 at 4:20 PM, <willchan@chromium.org> wrote: > > https://codereview.chromium.org/446203002/diff/80001/base/time/time_win.cc > File ...
6 years, 4 months ago (2014-08-15 23:33:08 UTC) #12
willchan no longer on Chromium
On Fri, Aug 15, 2014 at 4:33 PM, Nico Weber <thakis@chromium.org> wrote: > On Fri, ...
6 years, 4 months ago (2014-08-15 23:56:52 UTC) #13
M-A Ruel
Here's some code. It's probably overkill but hey. The current headers do not expose InterlockedCompareExchange64(). ...
6 years, 4 months ago (2014-08-16 00:40:14 UTC) #14
fmeawad
Jim, Will, Instead of adding an extra InitializeClock call that may add a race condition, ...
6 years, 4 months ago (2014-08-21 00:43:16 UTC) #15
jar (doing other things)
I think this is nice forward progress... improving code only now... and not adding anything ...
6 years, 4 months ago (2014-08-22 19:11:53 UTC) #16
fmeawad
+jam for chrome\browser\ content\app\ https://codereview.chromium.org/446203002/diff/100001/base/time/time_win.cc File base/time/time_win.cc (right): https://codereview.chromium.org/446203002/diff/100001/base/time/time_win.cc#newcode40 base/time/time_win.cc:40: On 2014/08/22 19:11:53, jar (gone ...
6 years, 4 months ago (2014-08-22 21:13:12 UTC) #17
jam
lgtm
6 years, 4 months ago (2014-08-25 01:57:49 UTC) #18
cpu_(ooo_6.6-7.5)
The CQ bit was checked by cpu@chromium.org
6 years, 4 months ago (2014-08-25 18:22:07 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmeawad@chromium.org/446203002/120001
6 years, 4 months ago (2014-08-25 18:23:14 UTC) #20
fmeawad
On 2014/08/25 18:23:14, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
6 years, 4 months ago (2014-08-25 18:36:31 UTC) #21
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-25 19:28:19 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-25 19:30:39 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/6431)
6 years, 4 months ago (2014-08-25 19:30:40 UTC) #24
willchan no longer on Chromium
Rubberstamping the LGTM from jar@ That said, I note again that there's a static initializer ...
6 years, 4 months ago (2014-08-25 23:07:25 UTC) #25
M-A Ruel
https://codereview.chromium.org/446203002/diff/120001/base/time/time_win.cc File base/time/time_win.cc (right): https://codereview.chromium.org/446203002/diff/120001/base/time/time_win.cc#newcode461 base/time/time_win.cc:461: NowFunction now_function = GetNowFunction(); On 2014/08/25 23:07:25, willchan wrote: ...
6 years, 4 months ago (2014-08-26 02:03:19 UTC) #26
M-A Ruel
On 2014/08/26 02:03:19, M-A Ruel wrote: > https://codereview.chromium.org/446203002/diff/120001/base/time/time_win.cc > File base/time/time_win.cc (right): > > https://codereview.chromium.org/446203002/diff/120001/base/time/time_win.cc#newcode461 ...
6 years, 4 months ago (2014-08-26 02:03:52 UTC) #27
fmeawad
On 2014/08/26 02:03:52, M-A Ruel wrote: > On 2014/08/26 02:03:19, M-A Ruel wrote: > > ...
6 years, 3 months ago (2014-08-26 20:04:02 UTC) #28
fmeawad
The CQ bit was checked by fmeawad@chromium.org
6 years, 3 months ago (2014-08-26 20:04:10 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fmeawad@chromium.org/446203002/120001
6 years, 3 months ago (2014-08-26 20:05:09 UTC) #30
commit-bot: I haz the power
Committed patchset #7 (120001) as 10c40c221c314e41add0a5b4df1ee7467681a430
6 years, 3 months ago (2014-08-26 20:11:39 UTC) #31
fmeawad
A revert of this CL (patchset #7) has been created in https://codereview.chromium.org/516693002/ by fmeawad@chromium.org. The ...
6 years, 3 months ago (2014-08-28 00:00:45 UTC) #32
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 02:45:22 UTC) #33
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/05399593156ef3b8d96933258cd32fe716f63461
Cr-Commit-Position: refs/heads/master@{#291974}

Powered by Google App Engine
This is Rietveld 408576698