|
|
Chromium Code Reviews|
Created:
4 years, 2 months ago by enne (OOO) Modified:
4 years, 2 months ago CC:
brianderson, cc-bugs_chromium.org, chromium-reviews, danakj, scheduler-bugs_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
Committed: https://crrev.com/ff408189176e09e6c8160cc3ac6d44bc9846ebef
Cr-Commit-Position: refs/heads/master@{#425449}
Patch Set 1 #
Total comments: 10
Patch Set 2 : Address review comments #Patch Set 3 : Rename expected draw function after danakj changes #
Messages
Total messages: 30 (17 generated)
Description was changed from
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
==========
to
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
==========
Description was changed from
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
==========
to
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
==========
The CQ bit was checked by enne@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
brianderson@chromium.org changed reviewers: + brianderson@chromium.org
https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler.cc File cc/scheduler/scheduler.cc (right): https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler.cc#n... cc/scheduler/scheduler.cc:322: Now() > adjusted_args.deadline) { Would it work to store this Now() and use it in both places?
https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... File cc/scheduler/scheduler_unittest.cc (right): https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... cc/scheduler/scheduler_unittest.cc:1331: // Advance frame and create a begin frame. Why do we need this extra frame in between? https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... cc/scheduler/scheduler_unittest.cc:1340: scheduler_->SetNeedsBeginMainFrame(); nit: Can you call SetNeedsBeginMainFrame before sending the begin frame? https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... cc/scheduler/scheduler_unittest.cc:1344: EXPECT_TRUE(client_->HasAction("WillBeginImplFrame")); nit: Can you use EXPECT_ACTION here?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
==========
to
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
==========
https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler.cc File cc/scheduler/scheduler.cc (right): https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler.cc#n... cc/scheduler/scheduler.cc:322: Now() > adjusted_args.deadline) { On 2016/10/12 at 20:38:17, brianderson wrote: > Would it work to store this Now() and use it in both places? Done. https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler.cc#n... cc/scheduler/scheduler.cc:322: Now() > adjusted_args.deadline) { On 2016/10/12 at 20:38:17, brianderson wrote: > Would it work to store this Now() and use it in both places? Done. https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... File cc/scheduler/scheduler_unittest.cc (right): https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... cc/scheduler/scheduler_unittest.cc:1331: // Advance frame and create a begin frame. On 2016/10/12 at 20:51:46, sunnyps wrote: > Why do we need this extra frame in between? Which extra frame? There's one frame where the main thread misses the deadline to get into the MissedLastDeadline state. Then there's this second frame which is delivered very late. https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... cc/scheduler/scheduler_unittest.cc:1340: scheduler_->SetNeedsBeginMainFrame(); On 2016/10/12 at 20:51:46, sunnyps wrote: > nit: Can you call SetNeedsBeginMainFrame before sending the begin frame? Done. https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... cc/scheduler/scheduler_unittest.cc:1344: EXPECT_TRUE(client_->HasAction("WillBeginImplFrame")); On 2016/10/12 at 20:51:46, sunnyps wrote: > nit: Can you use EXPECT_ACTION here? Done.
The CQ bit was checked by enne@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... File cc/scheduler/scheduler_unittest.cc (right): https://codereview.chromium.org/2418593002/diff/1/cc/scheduler/scheduler_unit... cc/scheduler/scheduler_unittest.cc:1331: // Advance frame and create a begin frame. On 2016/10/13 17:09:44, enne wrote: > On 2016/10/12 at 20:51:46, sunnyps wrote: > > Why do we need this extra frame in between? > > Which extra frame? There's one frame where the main thread misses the deadline > to get into the MissedLastDeadline state. Then there's this second frame which > is delivered very late. Ooh, sorry. Misread that.
lgtm too.
The CQ bit was checked by enne@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
Hmm, looks like failures are of the form: [ RUN ] SchedulerTest.MainFrameNotSkippedAfterLateBeginFrame ../../cc/scheduler/scheduler_unittest.cc:1346: Failure Value of: client_->Action(2) Actual: "ScheduledActionDrawIfPossible" Expected: "ScheduledActionDrawAndSwapIfPossible" Which is probably why the code that I cribbed from didn't use EXPECT_ACTION before. I will change it back to that so it can be more robust. This detail is not what the test is testing.
The CQ bit was checked by enne@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from sunnyps@chromium.org, brianderson@chromium.org Link to the patchset: https://codereview.chromium.org/2418593002/#ps40001 (title: "Rename expected draw function after danakj changes")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/10/14 at 18:54:30, enne wrote: > Hmm, looks like failures are of the form: > [ RUN ] SchedulerTest.MainFrameNotSkippedAfterLateBeginFrame > ../../cc/scheduler/scheduler_unittest.cc:1346: Failure > Value of: client_->Action(2) > Actual: "ScheduledActionDrawIfPossible" > Expected: "ScheduledActionDrawAndSwapIfPossible" > > Which is probably why the code that I cribbed from didn't use EXPECT_ACTION before. I will change it back to that so it can be more robust. This detail is not what the test is testing. Oh nevermind, this is just because of danakj's changes. *renaming*
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
==========
to
==========
Fix scheduler bug in skipping main frames
Previously the scheduler would think that it could skip a main frame if
the begin frame's start time + estimated time < deadline. However,
if this begin frame gets delivered very late, then this is incorrect,
and it's even possible that start time + estimated time < Now() and is
in the past, which doesn't make sense.
Instead, check if Now() + estimated time < deadline. This is the right
logic to see if it's possible to finish activation from the current
moment before the deadline.
This was causing problems where the following events would occur:
- browser has a 40ms draw
- browser delivers a begin frame
- renderer mistakenly thinks the activation fits below the deadline
even though estimated time > one frame
- renderer skips this begin main frame
- browser has another 40ms draw
- renderer now does a begin main frame, >40ms late
This was causing tab capture performance tests where the browser was
pegged with long draw operations to cause the renderer frame times to go
from 60 to 100ms.
R=sunnyps@chromium.org
BUG=632292
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
Committed: https://crrev.com/ff408189176e09e6c8160cc3ac6d44bc9846ebef
Cr-Commit-Position: refs/heads/master@{#425449}
==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/ff408189176e09e6c8160cc3ac6d44bc9846ebef Cr-Commit-Position: refs/heads/master@{#425449} |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
