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

Issue 2546423002: [Try # 3] Scheduler refactoring to virtually eliminate redundant DoWorks (Closed)

Created:
4 years ago by alex clarke (OOO till 29th)
Modified:
3 years, 10 months ago
Reviewers:
haraken, Sami, altimin
CC:
chromium-reviews, blink-reviews, cc-bugs_chromium.org, scheduler-bugs_chromium.org, altimin
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Scheduler refactoring to virtually eliminate redundant DoWorks Note this patch, while useful in it's own right, needs base messageloop cancellation support for full effect. Until that patch lands there may be some pointless wakeups for canceled DoWorks. This is of particular concern for using the scheduler on the compositor thread. Includes fix for telemetry and tsan issues. Also fixes a lock order inversion present in the second attempt. BUG=578176, 674238, 674157, 677404, 677041 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel Committed: https://crrev.com/3a6ffff92addfa71d401e2718ab99677520f250c Committed: https://crrev.com/8c6cf02ab73c8026ac2b0ca2aa8d6fd9bd8f2db0 Cr-Original-Original-Commit-Position: refs/heads/master@{#438173} Cr-Original-Commit-Position: refs/heads/master@{#438857} Review-Url: https://codereview.chromium.org/2546423002 Cr-Commit-Position: refs/heads/master@{#446380} Committed: https://chromium.googlesource.com/chromium/src/+/eda1d2e08c6769ebdbae66db618a2fae609f170c

Patch Set 1 #

Patch Set 2 : Few tweaks #

Total comments: 17

Patch Set 3 : for fun try work_batch_size_ = 100 #

Patch Set 4 : Responding to feedback and setting work_batch_size back to 4 #

Patch Set 5 : Rebased #

Total comments: 32

Patch Set 6 : Responding to feedback and adding some tests #

Patch Set 7 : Added the MoveableAutoLock per Sami's suggestion #

Total comments: 14

Patch Set 8 : Fixing nits #

Patch Set 9 : Fix nested messageloop problem #

Patch Set 10 : Fix lock order inversion #

Total comments: 2

Patch Set 11 : Fix telemetry plus address feedback #

Patch Set 12 : Rebase plus a number of small incremental fixes #

Patch Set 13 : Fix compile #

Patch Set 14 : Simplify immediate task relocading code for clarity #

Patch Set 15 : Add an extra dcheck #

Total comments: 2

Patch Set 16 : Rebased #

Patch Set 17 : Rebased #

Patch Set 18 : Rebase it's even smaller now! #

Total comments: 12

Patch Set 19 : Fixed a bug #

Patch Set 20 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+497 lines, -129 lines) Patch
M cc/test/ordered_simple_task_runner.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M cc/test/ordered_simple_task_runner.cc View 1 2 3 4 5 6 7 4 chunks +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/scheduler/base/moveable_auto_lock.h View 1 2 3 4 5 6 7 1 chunk +41 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +11 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 8 chunks +30 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 9 chunks +178 lines, -108 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +209 lines, -4 lines 0 comments Download

Messages

Total messages: 145 (110 generated)
Sami
I think overall it makes sense to be smarter about when to post DoWork(), and ...
4 years ago (2016-12-05 17:52:55 UTC) #9
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/2546423002/diff/20001/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc (right): https://codereview.chromium.org/2546423002/diff/20001/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc#newcode345 third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc:345: void TaskQueueImpl::OnIncomingImmediateTaskAvailable() { On 2016/12/05 17:52:54, Sami wrote: ...
4 years ago (2016-12-06 17:37:54 UTC) #12
Sami
Thanks for the fixes! Added a few more observations. https://codereview.chromium.org/2546423002/diff/20001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc (right): https://codereview.chromium.org/2546423002/diff/20001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc#newcode184 third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:184: ...
4 years ago (2016-12-07 16:13:43 UTC) #22
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/2546423002/diff/80001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc (right): https://codereview.chromium.org/2546423002/diff/80001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc#newcode61 third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:61: do_work_pending_lock_(), // NOTE this calls the constructor! On ...
4 years ago (2016-12-08 17:38:49 UTC) #28
alex clarke (OOO till 29th)
https://codereview.chromium.org/2546423002/diff/80001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc (right): https://codereview.chromium.org/2546423002/diff/80001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc#newcode206 third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:206: delegate_->PostTask(from_here, immediate_do_work_closure_); On 2016/12/07 16:13:42, Sami wrote: > Ditto ...
4 years ago (2016-12-08 17:40:28 UTC) #30
Sami
Great! lgtm with a few nits. https://codereview.chromium.org/2546423002/diff/120001/cc/scheduler/begin_frame_source_unittest.cc File cc/scheduler/begin_frame_source_unittest.cc (right): https://codereview.chromium.org/2546423002/diff/120001/cc/scheduler/begin_frame_source_unittest.cc#newcode93 cc/scheduler/begin_frame_source_unittest.cc:93: // There was ...
4 years ago (2016-12-09 11:04:02 UTC) #35
alex clarke (OOO till 29th)
+altimin@ you might want to have a look at this as well. https://codereview.chromium.org/2546423002/diff/120001/cc/scheduler/begin_frame_source_unittest.cc File cc/scheduler/begin_frame_source_unittest.cc ...
4 years ago (2016-12-12 11:45:04 UTC) #38
alex clarke (OOO till 29th)
haraken@chromium.org: Please review changes in third_party/WebKit/Source/platform/BUILD.gn
4 years ago (2016-12-12 17:21:17 UTC) #44
haraken
On 2016/12/12 17:21:17, alex clarke wrote: > mailto:haraken@chromium.org: Please review changes in > third_party/WebKit/Source/platform/BUILD.gn rs ...
4 years ago (2016-12-13 01:05:06 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2546423002/160001
4 years ago (2016-12-13 15:23:45 UTC) #58
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years ago (2016-12-13 15:28:51 UTC) #67
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/3a6ffff92addfa71d401e2718ab99677520f250c Cr-Commit-Position: refs/heads/master@{#438173}
4 years ago (2016-12-13 15:31:31 UTC) #69
gab
A revert of this CL (patchset #9 id:160001) has been created in https://codereview.chromium.org/2574363002/ by gab@chromium.org. ...
4 years ago (2016-12-14 19:34:19 UTC) #70
rnephew (Reviews Here)
On 2016/12/14 19:34:19, gab wrote: > A revert of this CL (patchset #9 id:160001) has ...
4 years ago (2016-12-14 22:15:03 UTC) #71
alex clarke (OOO till 29th)
Sami can you take another look? I've fixed the lock order inversion. BTW I'm going ...
4 years ago (2016-12-15 11:17:31 UTC) #77
Sami
https://codereview.chromium.org/2546423002/diff/180001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc (right): https://codereview.chromium.org/2546423002/diff/180001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc#newcode279 third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:279: for (internal::TaskQueueImpl* queue : has_incoming_immediate_work) { Would this fit ...
4 years ago (2016-12-15 11:45:45 UTC) #79
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/2546423002/diff/180001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc (right): https://codereview.chromium.org/2546423002/diff/180001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc#newcode279 third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:279: for (internal::TaskQueueImpl* queue : has_incoming_immediate_work) { On 2016/12/15 ...
4 years ago (2016-12-15 12:11:11 UTC) #80
alex clarke (OOO till 29th)
PTAL
4 years ago (2016-12-15 12:11:14 UTC) #81
Sami
lgtm, thanks.
4 years ago (2016-12-15 12:12:36 UTC) #84
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2546423002/200001
4 years ago (2016-12-15 12:16:11 UTC) #88
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/357011)
4 years ago (2016-12-15 15:13:29 UTC) #91
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2546423002/200001
4 years ago (2016-12-15 16:09:54 UTC) #93
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years ago (2016-12-15 17:21:25 UTC) #96
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/8c6cf02ab73c8026ac2b0ca2aa8d6fd9bd8f2db0 Cr-Commit-Position: refs/heads/master@{#438857}
4 years ago (2016-12-15 17:25:12 UTC) #98
gab
A revert of this CL (patchset #11 id:200001) has been created in https://codereview.chromium.org/2590593002/ by gab@chromium.org. ...
4 years ago (2016-12-19 19:45:28 UTC) #99
alex clarke (OOO till 29th)
Sami and Alexander would you mind taking a look at this?
3 years, 11 months ago (2017-01-16 18:11:33 UTC) #114
altimin
https://codereview.chromium.org/2546423002/diff/280001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc (right): https://codereview.chromium.org/2546423002/diff/280001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc#newcode331 third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:331: void TaskQueueManager::PostDoWorkContinuationLocked( Can you please add a DCHECK that ...
3 years, 11 months ago (2017-01-17 17:25:54 UTC) #117
alex clarke (OOO till 29th)
Sami can you have another look please? I think we're ready to try this again. ...
3 years, 10 months ago (2017-01-25 11:22:24 UTC) #123
Sami
Thanks again for simplifying this! Logic lgtm now, but left a few suggestions for making ...
3 years, 10 months ago (2017-01-26 12:29:17 UTC) #128
alex clarke (OOO till 29th)
PTAL https://codereview.chromium.org/2546423002/diff/340001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc (right): https://codereview.chromium.org/2546423002/diff/340001/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc#newcode219 third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc:219: return; On 2017/01/26 12:29:17, Sami wrote: > Could ...
3 years, 10 months ago (2017-01-26 15:22:38 UTC) #129
Sami
Thanks, still lgtm.
3 years, 10 months ago (2017-01-26 15:38:56 UTC) #134
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2546423002/380001
3 years, 10 months ago (2017-01-26 15:54:15 UTC) #138
commit-bot: I haz the power
Try jobs failed on following builders: linux_trusty_blink_rel on master.tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_trusty_blink_rel/builds/4178)
3 years, 10 months ago (2017-01-26 16:42:39 UTC) #140
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2546423002/380001
3 years, 10 months ago (2017-01-26 17:42:51 UTC) #142
commit-bot: I haz the power
3 years, 10 months ago (2017-01-26 18:24:27 UTC) #145
Message was sent while issue was closed.
Committed patchset #20 (id:380001) as
https://chromium.googlesource.com/chromium/src/+/eda1d2e08c6769ebdbae66db618a...

Powered by Google App Engine
This is Rietveld 408576698