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

Issue 1892033003: TaskScheduler [10] SchedulerWorkerThreadStack (Closed)

Created:
4 years, 8 months ago by fdoray
Modified:
4 years, 8 months ago
Reviewers:
robliao, danakj, gab
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@9_single_thread
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

TaskScheduler [10] SchedulerWorkerThreadStack A stack of SchedulerWorkerThreads. Supports removal of arbitrary SchedulerWorkerThreads. DCHECKs when a SchedulerWorkerThread is inserted multiple times. SchedulerWorkerThreads are not owned by the stack. Push() is amortized O(1). Pop(), Size() and Empty() are O(1). Remove is O(n). Removal of arbitrary elements is required to be able to remove a worker thread from the stack when it is woken up to run single-threaded tasks. BUG=553459 Committed: https://crrev.com/e7839991aabb3d5e79e971177e78640ed88d940f Cr-Commit-Position: refs/heads/master@{#389382}

Patch Set 1 #

Patch Set 2 : use bitfield to determine whether an element is on the stack #

Total comments: 8

Patch Set 3 : self review #

Patch Set 4 : self review #

Total comments: 6

Patch Set 5 : CR robliao #19 #

Patch Set 6 : rebase #

Patch Set 7 : stop using a bitfield #

Total comments: 6

Patch Set 8 : CR robliao #24 (SchedulerUniqueStack + nit) #

Total comments: 2

Patch Set 9 : CR robliao #26 (simplify a comment) #

Patch Set 10 : rebase #

Patch Set 11 : use SchedulerUniqueStack in STP #

Total comments: 6

Patch Set 12 : CR gab (improve comment) #

Total comments: 4

Patch Set 13 : CR danakj #41 (no template) #

Patch Set 14 : remove old file #

Total comments: 4

Patch Set 15 : fix typo #

Patch Set 16 : CR danakj #44 (Empty -> IsEmpty) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+276 lines, -23 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M base/task_scheduler/scheduler_thread_pool.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +2 lines, -6 lines 0 comments Download
M base/task_scheduler/scheduler_thread_pool.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +10 lines, -17 lines 0 comments Download
A base/task_scheduler/scheduler_worker_thread_stack.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +56 lines, -0 lines 0 comments Download
A base/task_scheduler/scheduler_worker_thread_stack.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +40 lines, -0 lines 0 comments Download
A base/task_scheduler/scheduler_worker_thread_stack_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +162 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 60 (23 generated)
fdoray
Can you review this CL? See how this will be used in https://codereview.chromium.org/1895513002/. Thanks!
4 years, 8 months ago (2016-04-15 18:48:47 UTC) #2
robliao
On 2016/04/15 18:48:47, fdoray wrote: > Can you review this CL? See how this will ...
4 years, 8 months ago (2016-04-15 20:04:17 UTC) #3
fdoray
On 2016/04/15 20:04:17, robliao wrote: > On 2016/04/15 18:48:47, fdoray wrote: > > Can you ...
4 years, 8 months ago (2016-04-15 22:03:08 UTC) #4
robliao
On 2016/04/15 22:03:08, fdoray wrote: > On 2016/04/15 20:04:17, robliao wrote: > > On 2016/04/15 ...
4 years, 8 months ago (2016-04-15 22:07:23 UTC) #5
robliao
On 2016/04/15 22:07:23, robliao wrote: > On 2016/04/15 22:03:08, fdoray wrote: > > On 2016/04/15 ...
4 years, 8 months ago (2016-04-15 22:10:06 UTC) #6
fdoray
On 2016/04/15 22:10:06, robliao wrote: > On 2016/04/15 22:07:23, robliao wrote: > > On 2016/04/15 ...
4 years, 8 months ago (2016-04-18 14:06:32 UTC) #7
fdoray
On 2016/04/18 14:06:32, fdoray wrote: > On 2016/04/15 22:10:06, robliao wrote: > > On 2016/04/15 ...
4 years, 8 months ago (2016-04-18 14:10:01 UTC) #8
robliao
On 2016/04/18 14:10:01, fdoray wrote: > On 2016/04/18 14:06:32, fdoray wrote: > > On 2016/04/15 ...
4 years, 8 months ago (2016-04-18 17:02:11 UTC) #9
fdoray
Can you take another look? Thanks.
4 years, 8 months ago (2016-04-18 18:14:52 UTC) #12
gab
bitfield approach sgtm, please augment CL description with reasoning behind current approach. Also please add ...
4 years, 8 months ago (2016-04-18 18:35:40 UTC) #13
fdoray
Can you take another look? Thanks. https://codereview.chromium.org/1892033003/diff/20001/base/task_scheduler/scheduler_stack.cc File base/task_scheduler/scheduler_stack.cc (right): https://codereview.chromium.org/1892033003/diff/20001/base/task_scheduler/scheduler_stack.cc#newcode24 base/task_scheduler/scheduler_stack.cc:24: bit_field_ |= 1ULL ...
4 years, 8 months ago (2016-04-18 20:33:13 UTC) #17
fdoray
To use this stack, we'll need to associate an index with each worker thread. I ...
4 years, 8 months ago (2016-04-18 21:04:54 UTC) #18
robliao
Nice! https://codereview.chromium.org/1892033003/diff/60001/base/task_scheduler/scheduler_stack.cc File base/task_scheduler/scheduler_stack.cc (right): https://codereview.chromium.org/1892033003/diff/60001/base/task_scheduler/scheduler_stack.cc#newcode42 base/task_scheduler/scheduler_stack.cc:42: DCHECK(!BitIsSet(bit_field_, val)); Let's add a message: DCHECK(..) << ...
4 years, 8 months ago (2016-04-19 00:41:16 UTC) #19
fdoray
robliao@/gab@: Done. Can you take another look? https://codereview.chromium.org/1892033003/diff/60001/base/task_scheduler/scheduler_stack.cc File base/task_scheduler/scheduler_stack.cc (right): https://codereview.chromium.org/1892033003/diff/60001/base/task_scheduler/scheduler_stack.cc#newcode42 base/task_scheduler/scheduler_stack.cc:42: DCHECK(!BitIsSet(bit_field_, val)); ...
4 years, 8 months ago (2016-04-19 14:05:50 UTC) #20
gab
We discussed offline with Francois: The speed benefits being in nanoseconds, being "4X faster" doesn't ...
4 years, 8 months ago (2016-04-20 15:53:12 UTC) #21
fdoray
robliao@/gab@: Can you review this CL? Thanks. I used a template because it allows SchedulerStack ...
4 years, 8 months ago (2016-04-20 19:00:23 UTC) #23
robliao
https://codereview.chromium.org/1892033003/diff/120001/base/task_scheduler/scheduler_stack.h File base/task_scheduler/scheduler_stack.h (right): https://codereview.chromium.org/1892033003/diff/120001/base/task_scheduler/scheduler_stack.h#newcode21 base/task_scheduler/scheduler_stack.h:21: Remove extra linebreak. https://codereview.chromium.org/1892033003/diff/120001/base/task_scheduler/scheduler_stack.h#newcode24 base/task_scheduler/scheduler_stack.h:24: class SchedulerStack { Given ...
4 years, 8 months ago (2016-04-20 20:54:58 UTC) #24
fdoray
robliao@: Done. Can you take another look? gab@: Can you review this CL? https://codereview.chromium.org/1892033003/diff/120001/base/task_scheduler/scheduler_stack.h File ...
4 years, 8 months ago (2016-04-20 21:04:42 UTC) #25
robliao
lgtm https://codereview.chromium.org/1892033003/diff/140001/base/task_scheduler/scheduler_unique_stack.h File base/task_scheduler/scheduler_unique_stack.h (right): https://codereview.chromium.org/1892033003/diff/140001/base/task_scheduler/scheduler_unique_stack.h#newcode35 base/task_scheduler/scheduler_unique_stack.h:35: // Removes |val| from the stack if it ...
4 years, 8 months ago (2016-04-20 21:18:40 UTC) #26
fdoray
https://codereview.chromium.org/1892033003/diff/140001/base/task_scheduler/scheduler_unique_stack.h File base/task_scheduler/scheduler_unique_stack.h (right): https://codereview.chromium.org/1892033003/diff/140001/base/task_scheduler/scheduler_unique_stack.h#newcode35 base/task_scheduler/scheduler_unique_stack.h:35: // Removes |val| from the stack if it was ...
4 years, 8 months ago (2016-04-21 15:34:11 UTC) #32
robliao
On 2016/04/21 15:34:11, fdoray wrote: > https://codereview.chromium.org/1892033003/diff/140001/base/task_scheduler/scheduler_unique_stack.h > File base/task_scheduler/scheduler_unique_stack.h (right): > > https://codereview.chromium.org/1892033003/diff/140001/base/task_scheduler/scheduler_unique_stack.h#newcode35 > ...
4 years, 8 months ago (2016-04-21 17:20:57 UTC) #33
fdoray
On 2016/04/21 17:20:57, robliao wrote: > On 2016/04/21 15:34:11, fdoray wrote: > > > https://codereview.chromium.org/1892033003/diff/140001/base/task_scheduler/scheduler_unique_stack.h ...
4 years, 8 months ago (2016-04-21 17:22:04 UTC) #34
robliao
On 2016/04/21 17:22:04, fdoray wrote: > On 2016/04/21 17:20:57, robliao wrote: > > On 2016/04/21 ...
4 years, 8 months ago (2016-04-21 17:26:22 UTC) #35
robliao
lgtm
4 years, 8 months ago (2016-04-21 19:10:59 UTC) #37
gab
lgtm w/ comment requests, thanks! https://codereview.chromium.org/1892033003/diff/200001/base/task_scheduler/scheduler_unique_stack.h File base/task_scheduler/scheduler_unique_stack.h (right): https://codereview.chromium.org/1892033003/diff/200001/base/task_scheduler/scheduler_unique_stack.h#newcode8 base/task_scheduler/scheduler_unique_stack.h:8: #include <stddef.h> Was that ...
4 years, 8 months ago (2016-04-22 17:07:04 UTC) #38
fdoray
danakj@: Can you review this CL? We have a more efficient implementation (see patch set ...
4 years, 8 months ago (2016-04-22 18:11:44 UTC) #40
danakj
https://codereview.chromium.org/1892033003/diff/220001/base/task_scheduler/scheduler_unique_stack.h File base/task_scheduler/scheduler_unique_stack.h (right): https://codereview.chromium.org/1892033003/diff/220001/base/task_scheduler/scheduler_unique_stack.h#newcode22 base/task_scheduler/scheduler_unique_stack.h:22: template <typename T> Are you going to use this ...
4 years, 8 months ago (2016-04-22 18:44:47 UTC) #41
fdoray
danakj@: Can you take another look? Thanks. https://codereview.chromium.org/1892033003/diff/220001/base/task_scheduler/scheduler_unique_stack.h File base/task_scheduler/scheduler_unique_stack.h (right): https://codereview.chromium.org/1892033003/diff/220001/base/task_scheduler/scheduler_unique_stack.h#newcode22 base/task_scheduler/scheduler_unique_stack.h:22: template <typename ...
4 years, 8 months ago (2016-04-22 20:45:20 UTC) #43
danakj
LGTM https://codereview.chromium.org/1892033003/diff/260001/base/task_scheduler/scheduler_worker_thread_stack.cc File base/task_scheduler/scheduler_worker_thread_stack.cc (right): https://codereview.chromium.org/1892033003/diff/260001/base/task_scheduler/scheduler_worker_thread_stack.cc#newcode25 base/task_scheduler/scheduler_worker_thread_stack.cc:25: if (Empty()) nit: usually contains DCHECK this and ...
4 years, 8 months ago (2016-04-22 21:08:12 UTC) #44
fdoray
https://codereview.chromium.org/1892033003/diff/260001/base/task_scheduler/scheduler_worker_thread_stack.cc File base/task_scheduler/scheduler_worker_thread_stack.cc (right): https://codereview.chromium.org/1892033003/diff/260001/base/task_scheduler/scheduler_worker_thread_stack.cc#newcode25 base/task_scheduler/scheduler_worker_thread_stack.cc:25: if (Empty()) On 2016/04/22 21:08:12, danakj wrote: > nit: ...
4 years, 8 months ago (2016-04-22 22:23:38 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1892033003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1892033003/300001
4 years, 8 months ago (2016-04-22 22:24:15 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/202673)
4 years, 8 months ago (2016-04-23 00:40:46 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1892033003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1892033003/300001
4 years, 8 months ago (2016-04-23 01:59:39 UTC) #52
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/202752)
4 years, 8 months ago (2016-04-23 03:50:19 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1892033003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1892033003/300001
4 years, 8 months ago (2016-04-23 16:23:15 UTC) #56
commit-bot: I haz the power
Committed patchset #16 (id:300001)
4 years, 8 months ago (2016-04-23 17:02:19 UTC) #58
commit-bot: I haz the power
4 years, 8 months ago (2016-04-23 17:04:30 UTC) #60
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/e7839991aabb3d5e79e971177e78640ed88d940f
Cr-Commit-Position: refs/heads/master@{#389382}

Powered by Google App Engine
This is Rietveld 408576698