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

Issue 1666283002: Reland - Refactor signaling in RWP (Closed)

Created:
4 years, 10 months ago by ericrk
Modified:
4 years, 9 months ago
Reviewers:
reveman, avi.rohit, no sievers, Eric Willigers
CC:
blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, jam, kinuko+watch, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor signaling in RWP A previous patch had moved RasterWorkerPool to make heavy use of broadcast in order to simplify logic a bit. It turns out that broadcast is not ideal in performance critical situations, as it increases lock contention (see https://code.google.com/p/chromium/codesearch#chromium/src/base/synchronization/condition_variable.h&l=34). This change removes all uses of broadcast other than in Shutdown, where performance is less of a concern and we actually need all threads to wake up. To achieve this, we need to re-factor RWP to use: - N foreground threads - 1 background thread rather than N threads which may be able to run foreground/background tasks. In order to ensure that we don't overload the system, this change introduces a limiting system where the background priority thread can only run tasks if no other threads are doing so. BUG= CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Committed: https://crrev.com/f064193fe71b8b055d060adb10fbc4e3cca8c604 Cr-Commit-Position: refs/heads/master@{#377379}

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : refactor #

Patch Set 4 : #

Total comments: 24

Patch Set 5 : feedback #

Patch Set 6 : rebase #

Patch Set 7 : fix build #

Total comments: 12

Patch Set 8 : feedback #

Total comments: 20

Patch Set 9 : feedback #

Patch Set 10 : Fix detection of already running tasks when category changes #

Patch Set 11 : Fix refcounting issue. #

Total comments: 2

Patch Set 12 : Avoid refcounting in schedule #

Total comments: 2

Patch Set 13 : x++ > ++x #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -57 lines) Patch
M cc/raster/task_graph_work_queue.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +16 lines, -1 line 0 comments Download
M cc/raster/task_graph_work_queue.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +17 lines, -9 lines 0 comments Download
M content/renderer/raster_worker_pool.h View 1 2 3 4 5 6 7 8 4 chunks +21 lines, -12 lines 0 comments Download
M content/renderer/raster_worker_pool.cc View 1 2 3 4 5 6 7 8 11 10 chunks +98 lines, -35 lines 1 comment Download

Messages

Total messages: 55 (24 generated)
ericrk
Hi David, Turns out that it's a bit tricky to get rid of broadcast without ...
4 years, 10 months ago (2016-02-04 21:23:51 UTC) #2
reveman
Some suggestions below which I'm not 100% sure makes sense. https://codereview.chromium.org/1666283002/diff/20001/content/renderer/raster_worker_pool.h File content/renderer/raster_worker_pool.h (right): https://codereview.chromium.org/1666283002/diff/20001/content/renderer/raster_worker_pool.h#newcode163 ...
4 years, 10 months ago (2016-02-05 17:15:03 UTC) #3
ericrk
Thanks! Took a stab at your suggestions. let me know how this looks.
4 years, 10 months ago (2016-02-08 17:48:30 UTC) #5
reveman
Looks great. Some nits, questions and minor suggestions. https://codereview.chromium.org/1666283002/diff/60001/cc/raster/task_graph_work_queue.h File cc/raster/task_graph_work_queue.h (right): https://codereview.chromium.org/1666283002/diff/60001/cc/raster/task_graph_work_queue.h#newcode148 cc/raster/task_graph_work_queue.h:148: uint32_t ...
4 years, 10 months ago (2016-02-08 19:10:22 UTC) #6
ericrk
https://chromiumcodereview.appspot.com/1666283002/diff/60001/cc/raster/task_graph_work_queue.h File cc/raster/task_graph_work_queue.h (right): https://chromiumcodereview.appspot.com/1666283002/diff/60001/cc/raster/task_graph_work_queue.h#newcode148 cc/raster/task_graph_work_queue.h:148: uint32_t NumRunningTasks() const { On 2016/02/08 19:10:21, reveman wrote: ...
4 years, 10 months ago (2016-02-10 18:44:50 UTC) #12
reveman
You can ignore the SignalHasReadyToRunTasks nits if you like. This looks good once I understand ...
4 years, 10 months ago (2016-02-10 20:49:32 UTC) #13
ericrk
Thanks for the feedback - tried to explain the reasoning behind the signaling pattern a ...
4 years, 10 months ago (2016-02-10 22:30:04 UTC) #14
reveman
lgtm % silly naming nits and a question https://chromiumcodereview.appspot.com/1666283002/diff/140001/content/renderer/raster_worker_pool.cc File content/renderer/raster_worker_pool.cc (right): https://chromiumcodereview.appspot.com/1666283002/diff/140001/content/renderer/raster_worker_pool.cc#newcode233 content/renderer/raster_worker_pool.cc:233: SignalHasReadyToRunTasksWithLockAcquired(); ...
4 years, 10 months ago (2016-02-10 23:25:09 UTC) #15
ericrk
Sievers, can you take a look for the content/ changes? Thanks! https://chromiumcodereview.appspot.com/1666283002/diff/160001/content/renderer/raster_worker_pool.cc File content/renderer/raster_worker_pool.cc (right): ...
4 years, 10 months ago (2016-02-11 00:22:02 UTC) #16
ericrk
+avi for content
4 years, 10 months ago (2016-02-11 21:51:24 UTC) #18
no sievers
lgtm
4 years, 10 months ago (2016-02-11 22:46:22 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1666283002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1666283002/180001
4 years, 10 months ago (2016-02-12 00:10:43 UTC) #22
commit-bot: I haz the power
Committed patchset #9 (id:180001)
4 years, 10 months ago (2016-02-12 01:13:57 UTC) #24
Sami
A revert of this CL (patchset #9 id:180001) has been created in https://codereview.chromium.org/1690023005/ by skyostil@chromium.org. ...
4 years, 10 months ago (2016-02-12 17:12:44 UTC) #25
amineer
On 2016/02/12 17:12:44, Sami wrote: > A revert of this CL (patchset #9 id:180001) has ...
4 years, 10 months ago (2016-02-12 18:38:26 UTC) #26
ericrk
The issue which caused crashes was due to the following: If we go to schedule ...
4 years, 10 months ago (2016-02-16 21:21:23 UTC) #27
reveman
lgtm
4 years, 10 months ago (2016-02-16 21:25:51 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1666283002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1666283002/200001
4 years, 10 months ago (2016-02-16 22:04:20 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/181770)
4 years, 10 months ago (2016-02-16 22:28:30 UTC) #33
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/997a61d92c0cd68a9fb336adfba3abd8849215c6 Cr-Commit-Position: refs/heads/master@{#375069}
4 years, 10 months ago (2016-02-16 22:40:20 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1666283002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1666283002/200001
4 years, 10 months ago (2016-02-23 22:11:41 UTC) #38
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/184587)
4 years, 10 months ago (2016-02-23 23:22:18 UTC) #40
ericrk
Turns out the trybot said this was committed, but there was actually a failure and ...
4 years, 10 months ago (2016-02-24 18:27:23 UTC) #42
reveman
https://codereview.chromium.org/1666283002/diff/240001/cc/raster/task_graph_work_queue.h File cc/raster/task_graph_work_queue.h (right): https://codereview.chromium.org/1666283002/diff/240001/cc/raster/task_graph_work_queue.h#newcode40 cc/raster/task_graph_work_queue.h:40: scoped_refptr<Task> task; hm, not sure about this. I'm worried ...
4 years, 10 months ago (2016-02-24 18:53:00 UTC) #43
ericrk
good point - updated with a new type to avoid this... PTAL. https://codereview.chromium.org/1666283002/diff/240001/cc/raster/task_graph_work_queue.h File cc/raster/task_graph_work_queue.h ...
4 years, 10 months ago (2016-02-24 19:30:44 UTC) #44
reveman
lgtm https://codereview.chromium.org/1666283002/diff/260001/cc/raster/task_graph_work_queue.h File cc/raster/task_graph_work_queue.h (right): https://codereview.chromium.org/1666283002/diff/260001/cc/raster/task_graph_work_queue.h#newcode156 cc/raster/task_graph_work_queue.h:156: count++; nit: ++count is typically preferred in chromium ...
4 years, 10 months ago (2016-02-24 19:34:29 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1666283002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1666283002/280001
4 years, 10 months ago (2016-02-24 19:47:33 UTC) #48
ericrk
https://codereview.chromium.org/1666283002/diff/260001/cc/raster/task_graph_work_queue.h File cc/raster/task_graph_work_queue.h (right): https://codereview.chromium.org/1666283002/diff/260001/cc/raster/task_graph_work_queue.h#newcode156 cc/raster/task_graph_work_queue.h:156: count++; On 2016/02/24 19:34:29, reveman wrote: > nit: ++count ...
4 years, 10 months ago (2016-02-24 19:49:27 UTC) #49
commit-bot: I haz the power
Committed patchset #13 (id:280001)
4 years, 10 months ago (2016-02-24 21:17:19 UTC) #51
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/f064193fe71b8b055d060adb10fbc4e3cca8c604 Cr-Commit-Position: refs/heads/master@{#377379}
4 years, 10 months ago (2016-02-24 21:18:24 UTC) #53
Eric Willigers
4 years, 9 months ago (2016-03-07 09:42:47 UTC) #55
Message was sent while issue was closed.
https://codereview.chromium.org/1666283002/diff/280001/content/renderer/raste...
File content/renderer/raster_worker_pool.cc (right):

https://codereview.chromium.org/1666283002/diff/280001/content/renderer/raste...
content/renderer/raster_worker_pool.cc:31: categories_(categories),
Perhaps
categories_(std::move(categories)),

Powered by Google App Engine
This is Rietveld 408576698