|
|
Created:
4 years, 3 months ago by alex clarke (OOO till 29th) Modified:
4 years, 3 months ago Reviewers:
Sami CC:
chromium-reviews, blink-reviews, scheduler-bugs_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionPrevent redundant DoWorks due to canceled delayed tasks
To achieve this we make a few changes:
1. We only register the next wakeup with the TimeDomain, rather than all
of them.
2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next
wakeup (if any). Since it removes all canceled delayed tasks from the
front of the priority queue this has the effect of not scheduling
wakeups for cancelled tasks.
3. Tweaking the TaskQueueManager level delayed DoWork de-duplication
logic to only post a delayed DoWork if the task is meant to run before
any previously registered delayed DoWorks.
BUG=638542, 605718
Committed: https://crrev.com/929cbb9f92b5570867c3842c80778243db81a013
Cr-Commit-Position: refs/heads/master@{#418556}
Patch Set 1 #Patch Set 2 : Fix test failure #Patch Set 3 : Rebased #Patch Set 4 : Change tack, only post the next wakeup with the TimeDomain #Patch Set 5 : Added a commant. #
Total comments: 6
Patch Set 6 : Changes for Sami #
Messages
Total messages: 40 (29 generated)
The CQ bit was checked by alexclarke@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
alexclarke@chromium.org changed reviewers: + skyostil@chromium.org
PTAL!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by alexclarke@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by alexclarke@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Here's a dumb question: when scheduling the next wake up in the time domain, why don't we check for cancelled tasks at that point and skip forward until we find a task which wasn't cancelled? It doesn't seem like sweeping the tasks away eagerly buys us much on top of making sure we don't schedule a wake up for a task which was cancelled.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Periodically sweep away incoming canceled delayed tasks This helps avoid pointless wakeups and reduces the size of the incoming delayed task queues which would often otherwise contain a lot of canceled delayed tasks. BUG=638542 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ==========
The CQ bit was checked by alexclarke@chromium.org to run a CQ dry run
On 2016/09/12 15:30:32, Sami wrote: > Here's a dumb question: when scheduling the next wake up in the time domain, why > don't we check for cancelled tasks at that point and skip forward until we find > a task which wasn't cancelled? It doesn't seem like sweeping the tasks away > eagerly buys us much on top of making sure we don't schedule a wake up for a > task which was cancelled. Turns out it was easier to do that than anticipated. PTAL.
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ==========
Description was changed from ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ==========
Description was changed from ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ==========
Description was changed from ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ==========
lgtm -- I like how this clarifies the responsibility of the TimeDomain. https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h (right): https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h:177: void MoveReadyDelayedTasksToDelayedWorkQueue(LazyNow* lazy_now); Not sure if we need to do this now, but maybe we could rename this function to something like ProcessDelayedWork() or something else that better captures its new role. https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc (right): https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc:1894: for (;;) { nit: could extract this to a helper method -- up to you. https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/scheduler/base/time_domain.h (right): https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/scheduler/base/time_domain.h:34: // have nit: reformat
https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h (right): https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h:177: void MoveReadyDelayedTasksToDelayedWorkQueue(LazyNow* lazy_now); On 2016/09/13 17:42:53, Sami wrote: > Not sure if we need to do this now, but maybe we could rename this function to > something like ProcessDelayedWork() or something else that better captures its > new role. Done. https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc (right): https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc:1894: for (;;) { On 2016/09/13 17:42:53, Sami wrote: > nit: could extract this to a helper method -- up to you. Done. https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/platform/scheduler/base/time_domain.h (right): https://codereview.chromium.org/2320403003/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/platform/scheduler/base/time_domain.h:34: // have On 2016/09/13 17:42:53, Sami wrote: > nit: reformat Done.
The CQ bit was checked by alexclarke@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from skyostil@chromium.org Link to the patchset: https://codereview.chromium.org/2320403003/#ps100001 (title: "Changes for Sami")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542, 605718 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_...)
The CQ bit was checked by alexclarke@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542, 605718 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542, 605718 ==========
Message was sent while issue was closed.
Committed patchset #6 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542, 605718 ========== to ========== Prevent redundant DoWorks due to canceled delayed tasks To achieve this we make a few changes: 1. We only register the next wakeup with the TimeDomain, rather than all of them. 2. MoveReadyDelayedTasksToDelayedWorkQueue now registers the next wakeup (if any). Since it removes all canceled delayed tasks from the front of the priority queue this has the effect of not scheduling wakeups for cancelled tasks. 3. Tweaking the TaskQueueManager level delayed DoWork de-duplication logic to only post a delayed DoWork if the task is meant to run before any previously registered delayed DoWorks. BUG=638542, 605718 Committed: https://crrev.com/929cbb9f92b5570867c3842c80778243db81a013 Cr-Commit-Position: refs/heads/master@{#418556} ==========
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/929cbb9f92b5570867c3842c80778243db81a013 Cr-Commit-Position: refs/heads/master@{#418556}
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/2353473003/ by kbr@chromium.org. The reason for reverting is: Suspect that this CL caused breakage in Gmail and Hangouts per http://crbug.com/647484 . . |