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

Issue 1886453003: Make PendingTask move-only and pass it by value on retaining params (Closed)

Created:
4 years, 8 months ago by tzik
Modified:
4 years, 5 months ago
Reviewers:
Nico, Sami
CC:
chromium-reviews, scheduler-bugs_chromium.org, sadrul
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make PendingTask move-only and pass it by value on retaining params PendingTask is copied several time when it's created and consumed in MessageLoop, and each copy operation implies two atomicops on ref-count bump on Callback. This CL removes them by migrating to pass-by-move. Chrome has performed ~100k atomic ops for Callback ref-count (50k inc and 50k dec) on the first 15s after boot before this CL, and it will be reduced to ~50k after this CL. Committed: https://crrev.com/b6769d5fc8557a8bc03cc3a24fde154ce7a4d1eb Cr-Commit-Position: refs/heads/master@{#404229}

Patch Set 1 #

Patch Set 2 : #

Total comments: 10

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : Remove TaskQueue impl #

Patch Set 6 : disable WorkQueue copy #

Total comments: 6

Patch Set 7 : remove PopOutFromPriorityQueue #

Patch Set 8 : rebase #

Patch Set 9 : mac test fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -63 lines) Patch
M base/message_loop/message_loop.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M base/message_loop/message_loop.cc View 1 2 3 4 5 6 7 8 5 chunks +18 lines, -14 lines 0 comments Download
M base/message_loop/message_pump_perftest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M base/pending_task.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -3 lines 0 comments Download
M base/pending_task.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -5 lines 0 comments Download
M base/threading/worker_pool_posix.cc View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download
M components/scheduler/base/task_queue_impl.h View 1 2 3 4 5 6 2 chunks +4 lines, -4 lines 0 comments Download
M components/scheduler/base/task_queue_impl.cc View 1 2 3 4 5 6 3 chunks +32 lines, -20 lines 0 comments Download
M components/scheduler/base/task_queue_manager.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M components/scheduler/base/work_queue.h View 1 2 3 4 5 2 chunks +4 lines, -2 lines 0 comments Download
M components/scheduler/base/work_queue.cc View 1 2 2 chunks +14 lines, -8 lines 0 comments Download

Messages

Total messages: 55 (21 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1886453003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1886453003/1
4 years, 8 months ago (2016-04-13 04:11:18 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1886453003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1886453003/20001
4 years, 8 months ago (2016-04-13 04:30:39 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/173717)
4 years, 8 months ago (2016-04-13 05:41:37 UTC) #6
tzik
PTAL
4 years, 8 months ago (2016-04-13 11:12:35 UTC) #9
Sami
Thanks for the optimization! How did you measure the number of atomic ops by the ...
4 years, 8 months ago (2016-04-13 11:33:01 UTC) #10
tzik
On 2016/04/13 11:33:01, Sami wrote: > Thanks for the optimization! How did you measure the ...
4 years, 8 months ago (2016-04-13 14:34:58 UTC) #11
tzik
Updated! https://codereview.chromium.org/1886453003/diff/20001/base/message_loop/incoming_task_queue.cc File base/message_loop/incoming_task_queue.cc (right): https://codereview.chromium.org/1886453003/diff/20001/base/message_loop/incoming_task_queue.cc#newcode159 base/message_loop/incoming_task_queue.cc:159: DCHECK(pending_task->task.is_null()); On 2016/04/13 11:33:00, Sami wrote: > Is ...
4 years, 8 months ago (2016-04-13 14:35:37 UTC) #12
Sami
https://codereview.chromium.org/1886453003/diff/20001/base/message_loop/incoming_task_queue.cc File base/message_loop/incoming_task_queue.cc (right): https://codereview.chromium.org/1886453003/diff/20001/base/message_loop/incoming_task_queue.cc#newcode159 base/message_loop/incoming_task_queue.cc:159: DCHECK(pending_task->task.is_null()); On 2016/04/13 14:35:37, tzik wrote: > On 2016/04/13 ...
4 years, 8 months ago (2016-04-13 15:17:32 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1886453003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1886453003/40001
4 years, 8 months ago (2016-04-14 19:11:11 UTC) #15
commit-bot: I haz the power
Dry run: 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/159732) ios_rel_device_ninja on ...
4 years, 8 months ago (2016-04-14 19:17:27 UTC) #17
tzik
https://codereview.chromium.org/1886453003/diff/20001/base/message_loop/incoming_task_queue.cc File base/message_loop/incoming_task_queue.cc (right): https://codereview.chromium.org/1886453003/diff/20001/base/message_loop/incoming_task_queue.cc#newcode159 base/message_loop/incoming_task_queue.cc:159: DCHECK(pending_task->task.is_null()); On 2016/04/13 15:17:32, Sami wrote: > On 2016/04/13 ...
4 years, 8 months ago (2016-04-14 19:44:30 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1886453003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1886453003/60001
4 years, 8 months ago (2016-04-14 19:44:55 UTC) #20
commit-bot: I haz the power
Dry run: 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/211402)
4 years, 8 months ago (2016-04-14 20:45:48 UTC) #22
Sami
Thanks, lgtm.
4 years, 8 months ago (2016-04-15 13:02:53 UTC) #23
tzik
I'll look into Windows build failure next week after I go back to my home ...
4 years, 8 months ago (2016-04-15 13:45:25 UTC) #24
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1886453003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1886453003/80001
4 years, 8 months ago (2016-04-20 08:11:43 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1886453003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1886453003/100001
4 years, 8 months ago (2016-04-20 08:59:11 UTC) #28
tzik
Updated. I had to prevent instantiations of copy-ctor of std::queue to fix windows build. PTAL.
4 years, 8 months ago (2016-04-20 10:08:35 UTC) #29
commit-bot: I haz the power
Dry run: 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/214222)
4 years, 8 months ago (2016-04-20 10:16:25 UTC) #31
Sami
Still lgtm.
4 years, 8 months ago (2016-04-20 10:34:07 UTC) #32
tzik
Nico: Could you review this?
4 years, 8 months ago (2016-04-22 15:22:15 UTC) #33
Nico
sorry, I missed this. basically lgtm. do you have any data on how expensive the ...
4 years, 8 months ago (2016-04-22 15:32:16 UTC) #34
tzik
On 2016/04/22 15:32:16, Nico wrote: > sorry, I missed this. basically lgtm. do you have ...
4 years, 8 months ago (2016-04-25 11:36:11 UTC) #35
tzik
https://codereview.chromium.org/1886453003/diff/100001/base/stl_util.h File base/stl_util.h (right): https://codereview.chromium.org/1886453003/diff/100001/base/stl_util.h#newcode261 base/stl_util.h:261: template <typename PriorityQueue> On 2016/04/22 15:32:16, Nico wrote: > ...
4 years, 8 months ago (2016-04-25 11:36:27 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1886453003/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1886453003/120001
4 years, 8 months ago (2016-04-25 11:37:40 UTC) #39
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/216708)
4 years, 8 months ago (2016-04-25 13:22:40 UTC) #41
tzik
Let me resurrect this. I finally understand why the mac test was failing. It was ...
4 years, 5 months ago (2016-07-07 13:27:58 UTC) #42
Nico
ah! lgtm.
4 years, 5 months ago (2016-07-07 13:30:10 UTC) #43
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/1886453003/160001
4 years, 5 months ago (2016-07-07 14:05:34 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
4 years, 5 months ago (2016-07-07 16:07:57 UTC) #48
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/1886453003/160001
4 years, 5 months ago (2016-07-07 18:34:54 UTC) #50
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 5 months ago (2016-07-07 20:20:24 UTC) #52
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-07 20:20:53 UTC) #53
commit-bot: I haz the power
4 years, 5 months ago (2016-07-07 20:23:21 UTC) #55
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/b6769d5fc8557a8bc03cc3a24fde154ce7a4d1eb
Cr-Commit-Position: refs/heads/master@{#404229}

Powered by Google App Engine
This is Rietveld 408576698