|
|
Created:
4 years, 6 months ago by hajimehoshi Modified:
4 years, 2 months ago Reviewers:
Georges Khalil, chrisha, Sami CC:
chromium-reviews, scheduler-bugs_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionSuspend more task queues for background renderers (experimental)
Backgrounded-tab suspending was introduced at crrev/1914143002, where
only the timer task queue was suspended. We knew this was not enough and
we need to suspend more task queues to prevent the return of purged
cache.
This CL adds the feature to suspend these task queues besides timer task
queues when backgrounded-tab suspending starts:
* default_loading_tq
* frame_loading_tq
The above task queues might call V8 functions, which means any purged cache
can be reverted.
This CL doesn't suspend "default_tq" (which we can't suspend since this
conveys critial tasks) and "idle_tq" (which I think is not harmful for
purged caches), "control_(after_wakeup_)tq" (which is only for internal
scheduler housekeeping tasks) and "compositor_tq" (which is not used when
the renderer is backgrounded).
BUG=607077
TEST=n/a
Committed: https://crrev.com/e9897950a1574e0842dc86e0c50e6695773edf41
Cr-Commit-Position: refs/heads/master@{#397990}
Patch Set 1 : #
Total comments: 2
Patch Set 2 : Address Sami's review #
Total comments: 2
Patch Set 3 : Address on Sami's review #Patch Set 4 : Fix tests #Patch Set 5 : Rebasing #
Created: 4 years, 6 months ago
Depends on Patchset: Messages
Total messages: 21 (7 generated)
Patchset #1 (id:1) has been deleted
hajimehoshi@chromium.org changed reviewers: + chrisha@chromium.org, georgesak@chromium.org, skyostil@chromium.org
Sami: I'm not confident with suspending control(_after_wakeup)_tq. Is this OK? PTAL
Description was changed from ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * compositor_tq * control_tq * control_after_wakeup_tq * (default|frame)_loading_tq All of them might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches). BUG=607077 TEST=n/a ========== to ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * compositor_tq * control_tq * control_after_wakeup_tq * (default|frame)_loading_tq Some of them might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches). BUG=607077 TEST=n/a ==========
I think we can avoid suspending any of the control task queues, because those are only used for internal scheduler housekeeping tasks which will never call outside code. Similarly it's probably not useful to suspend the compositor task queue because there won't be any compositing activity happening for backgrounded renderers. Something we could consider is adding UMA and/or tracing to measure how often tasks are executed in suspended renderers. https://codereview.chromium.org/2017763003/diff/20001/components/scheduler/re... File components/scheduler/renderer/renderer_scheduler_impl.h (right): https://codereview.chromium.org/2017763003/diff/20001/components/scheduler/re... components/scheduler/renderer/renderer_scheduler_impl.h:341: bool queue_suspended; Maybe renderer_suspended would be a more descriptive name for this? Also maybe move it together with the other renderer_* flags above.
Description was changed from ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * compositor_tq * control_tq * control_after_wakeup_tq * (default|frame)_loading_tq Some of them might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches). BUG=607077 TEST=n/a ========== to ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * default_loading_tq * frame_loading_tq The above task queues might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches), "control_(after_wakeup_)tq" (which is only for internal scheduler housekeeping tasks) and "compositor_tq" (which is not used when the renderer is backgrounded). BUG=607077 TEST=n/a ==========
Thank you! I also fixed not to suspend controller_*_tq and compositor_tq. https://codereview.chromium.org/2017763003/diff/20001/components/scheduler/re... File components/scheduler/renderer/renderer_scheduler_impl.h (right): https://codereview.chromium.org/2017763003/diff/20001/components/scheduler/re... components/scheduler/renderer/renderer_scheduler_impl.h:341: bool queue_suspended; On 2016/05/27 14:08:57, Sami wrote: > Maybe renderer_suspended would be a more descriptive name for this? Also maybe > move it together with the other renderer_* flags above. Done.
https://codereview.chromium.org/2017763003/diff/40001/components/scheduler/re... File components/scheduler/renderer/renderer_scheduler_impl.cc (right): https://codereview.chromium.org/2017763003/diff/40001/components/scheduler/re... components/scheduler/renderer/renderer_scheduler_impl.cc:1223: MainThreadOnly().renderer_suspended = true; I guess this is just for testing, but ultimately you'd want to do this in RendererSchedulerImpl::SuspendRenderer().
https://codereview.chromium.org/2017763003/diff/40001/components/scheduler/re... File components/scheduler/renderer/renderer_scheduler_impl.cc (right): https://codereview.chromium.org/2017763003/diff/40001/components/scheduler/re... components/scheduler/renderer/renderer_scheduler_impl.cc:1223: MainThreadOnly().renderer_suspended = true; On 2016/05/31 10:11:21, Sami wrote: > I guess this is just for testing, but ultimately you'd want to do this in > RendererSchedulerImpl::SuspendRenderer(). Ah, this was my mistake: Setting this variable should be in SuspendRenderer as you suggested. Done.
Thanks, looks great. Please add a test if you want to land this for real.
On 2016/05/31 14:21:03, Sami wrote: > Thanks, looks great. Please add a test if you want to land this for real. Thanks, Done.
Thanks, lgtm.
The CQ bit was checked by hajimehoshi@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017763003/100001
Message was sent while issue was closed.
Description was changed from ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * default_loading_tq * frame_loading_tq The above task queues might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches), "control_(after_wakeup_)tq" (which is only for internal scheduler housekeeping tasks) and "compositor_tq" (which is not used when the renderer is backgrounded). BUG=607077 TEST=n/a ========== to ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * default_loading_tq * frame_loading_tq The above task queues might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches), "control_(after_wakeup_)tq" (which is only for internal scheduler housekeeping tasks) and "compositor_tq" (which is not used when the renderer is backgrounded). BUG=607077 TEST=n/a ==========
Message was sent while issue was closed.
Committed patchset #5 (id:100001)
Message was sent while issue was closed.
Description was changed from ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * default_loading_tq * frame_loading_tq The above task queues might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches), "control_(after_wakeup_)tq" (which is only for internal scheduler housekeeping tasks) and "compositor_tq" (which is not used when the renderer is backgrounded). BUG=607077 TEST=n/a ========== to ========== Suspend more task queues for background renderers (experimental) Backgrounded-tab suspending was introduced at crrev/1914143002, where only the timer task queue was suspended. We knew this was not enough and we need to suspend more task queues to prevent the return of purged cache. This CL adds the feature to suspend these task queues besides timer task queues when backgrounded-tab suspending starts: * default_loading_tq * frame_loading_tq The above task queues might call V8 functions, which means any purged cache can be reverted. This CL doesn't suspend "default_tq" (which we can't suspend since this conveys critial tasks) and "idle_tq" (which I think is not harmful for purged caches), "control_(after_wakeup_)tq" (which is only for internal scheduler housekeeping tasks) and "compositor_tq" (which is not used when the renderer is backgrounded). BUG=607077 TEST=n/a Committed: https://crrev.com/e9897950a1574e0842dc86e0c50e6695773edf41 Cr-Commit-Position: refs/heads/master@{#397990} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/e9897950a1574e0842dc86e0c50e6695773edf41 Cr-Commit-Position: refs/heads/master@{#397990}
Message was sent while issue was closed.
Sami: I'm just curious, but does this CL suspend not only the default timer & loading task runners but also per-frame timer & loading task runners?
Message was sent while issue was closed.
On 2016/10/07 06:34:39, haraken wrote: > Sami: I'm just curious, but does this CL suspend not only the default timer & > loading task runners but also per-frame timer & loading task runners? Yes, see these loops here where the policies are applied to all task queues of the respective type: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/sched... |