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

Issue 1303353003: scheduler: Disable expensive timers during main thread user input (Closed)

Created:
5 years, 4 months ago by Sami
Modified:
5 years, 4 months ago
CC:
chromium-reviews, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, scheduler-bugs_chromium.org, droger+watchlist_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

scheduler: Disable expensive timers during main thread user input Previously, if the user was interacting with the device, we would only allow timers to run during idle periods. Turns out this strategy wasn't effective with workloads with very expensive timers. This is because even the occasional idle period is enough to let a long running timer execute, potentially causing jank. This patch changes the heuristic to be based on the expected run time of each timer task. The estimation is based on historical run times. If we have seen user input recently and the main thread is on the critical path, we now disable timer tasks completely for the duration of the interaction. As a follow up we may want to consider doing similar estimation for loading tasks, as well as estimating workloads from different domains separately. BUG=523406 Committed: https://crrev.com/e8b4542c35200e17ea6cadfb1d3f0cab13a563bc Cr-Commit-Position: refs/heads/master@{#344858}

Patch Set 1 #

Total comments: 8

Patch Set 2 : TaskQueueManager unit tests (+ fix a bug they found). #

Patch Set 3 : Removed hardcoding. #

Total comments: 4

Patch Set 4 : Add a trace counter. #

Patch Set 5 : Add test for estimator. #

Patch Set 6 : Review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+323 lines, -31 lines) Patch
M components/components_tests.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/scheduler/BUILD.gn View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/scheduler/child/task_queue.h View 2 chunks +8 lines, -0 lines 0 comments Download
M components/scheduler/child/task_queue_impl.h View 3 chunks +7 lines, -0 lines 0 comments Download
M components/scheduler/child/task_queue_impl.cc View 1 1 chunk +28 lines, -0 lines 0 comments Download
M components/scheduler/child/task_queue_manager.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M components/scheduler/child/task_queue_manager_unittest.cc View 1 1 chunk +50 lines, -0 lines 0 comments Download
M components/scheduler/renderer/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl.h View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl.cc View 1 2 3 4 5 9 chunks +50 lines, -16 lines 0 comments Download
M components/scheduler/renderer/renderer_scheduler_impl_unittest.cc View 1 2 2 chunks +18 lines, -15 lines 0 comments Download
A components/scheduler/renderer/task_cost_estimator.h View 1 2 3 4 1 chunk +46 lines, -0 lines 0 comments Download
A components/scheduler/renderer/task_cost_estimator.cc View 1 2 3 4 1 chunk +38 lines, -0 lines 0 comments Download
A components/scheduler/renderer/task_cost_estimator_unittest.cc View 1 2 3 4 1 chunk +65 lines, -0 lines 0 comments Download
M components/scheduler/scheduler.gypi View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (8 generated)
Sami
Tests forthcoming.
5 years, 4 months ago (2015-08-21 17:00:08 UTC) #2
alex clarke (OOO till 29th)
Needs some tests :) https://codereview.chromium.org/1303353003/diff/1/components/scheduler/renderer/renderer_scheduler_impl.cc File components/scheduler/renderer/renderer_scheduler_impl.cc (left): https://codereview.chromium.org/1303353003/diff/1/components/scheduler/renderer/renderer_scheduler_impl.cc#oldcode519 components/scheduler/renderer/renderer_scheduler_impl.cc:519: if (!AnyThread().in_idle_period_ && Can you ...
5 years, 4 months ago (2015-08-21 17:13:30 UTC) #3
Sami
https://codereview.chromium.org/1303353003/diff/1/components/scheduler/renderer/renderer_scheduler_impl.cc File components/scheduler/renderer/renderer_scheduler_impl.cc (left): https://codereview.chromium.org/1303353003/diff/1/components/scheduler/renderer/renderer_scheduler_impl.cc#oldcode519 components/scheduler/renderer/renderer_scheduler_impl.cc:519: if (!AnyThread().in_idle_period_ && On 2015/08/21 17:13:30, alexclarke1 wrote: > ...
5 years, 4 months ago (2015-08-21 17:42:22 UTC) #4
alex clarke (OOO till 29th)
https://codereview.chromium.org/1303353003/diff/40001/components/scheduler/renderer/renderer_scheduler_impl.cc File components/scheduler/renderer/renderer_scheduler_impl.cc (right): https://codereview.chromium.org/1303353003/diff/40001/components/scheduler/renderer/renderer_scheduler_impl.cc#newcode437 components/scheduler/renderer/renderer_scheduler_impl.cc:437: Maybe add a todo to trace in the detailed ...
5 years, 4 months ago (2015-08-21 17:56:46 UTC) #5
Sami
https://codereview.chromium.org/1303353003/diff/40001/components/scheduler/renderer/renderer_scheduler_impl.cc File components/scheduler/renderer/renderer_scheduler_impl.cc (right): https://codereview.chromium.org/1303353003/diff/40001/components/scheduler/renderer/renderer_scheduler_impl.cc#newcode437 components/scheduler/renderer/renderer_scheduler_impl.cc:437: On 2015/08/21 17:56:46, alexclarke1 wrote: > Maybe add a ...
5 years, 4 months ago (2015-08-21 18:14:42 UTC) #6
alex clarke (OOO till 29th)
lgtm
5 years, 4 months ago (2015-08-21 18:16:46 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1303353003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1303353003/100001
5 years, 4 months ago (2015-08-21 18:19:47 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/59904)
5 years, 4 months ago (2015-08-21 18:36:55 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1303353003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1303353003/100001
5 years, 4 months ago (2015-08-21 18:41:31 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/59918)
5 years, 4 months ago (2015-08-21 19:04:57 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1303353003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1303353003/100001
5 years, 4 months ago (2015-08-21 19:32:17 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/59969)
5 years, 4 months ago (2015-08-21 19:56:56 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1303353003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1303353003/100001
5 years, 4 months ago (2015-08-21 20:51:10 UTC) #21
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 4 months ago (2015-08-21 21:04:49 UTC) #22
commit-bot: I haz the power
5 years, 4 months ago (2015-08-21 21:05:43 UTC) #23
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/e8b4542c35200e17ea6cadfb1d3f0cab13a563bc
Cr-Commit-Position: refs/heads/master@{#344858}

Powered by Google App Engine
This is Rietveld 408576698