New issue
Advanced search Search tips

Issue 783298 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 1
Type: Bug

Blocking:
issue 787189



Sign in to add a comment

WebGL Aquarium hangs with 25,000 fish on macOS

Project Member Reported by kbr@chromium.org, Nov 9 2017

Issue description

Chrome Version: 64.0.3263.0 (Official Build) canary (64-bit)
OS: macOS 10.13.1

What steps will reproduce the problem?
(1) On a MacBook Pro with AMD GPU running 10.13, go to https://webglsamples.org/aquarium/aquarium.html
(2) Select 25,000 fish
(3) Wait

What is the expected result?

Expect demo to render reliably.


What happens instead?

Usually after about 10 seconds, the demo stops rendering. All renderers appear to halt rendering at this point. I've attempted to gather about:tracing just before the browser gets into this state, but at that point, the about:tracing tab (definitely running in a different renderer process) doesn't update any more.

Usually resizing the window, switching windows, etc., will get the demo and other renderers' contents rendering again. It looks like the browser compositor is still working in this state.

For some reason this doesn't seem to show up on 10.12.

I suspect this is related to the use of DescheduleUntilFinishedCHROMIUM and some sort of deadlock between WebGL and the compositor. Will do a build removing that from WebGL's DrawingBuffer to try to confirm. Marking P1 because this could be affecting almost any WebGL content.

about:gpu follows.


Note: To properly save this page, select the "Webpage, Complete" option in the Save File dialog.
Graphics Feature Status
Canvas: Hardware accelerated
CheckerImaging: Enabled
Flash: Hardware accelerated
Flash Stage3D: Hardware accelerated
Flash Stage3D Baseline profile: Hardware accelerated
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Native GpuMemoryBuffers: Hardware accelerated
Rasterization: Hardware accelerated
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
Driver Bug Workarounds
add_and_true_to_loop_condition
adjust_src_dst_region_for_blitframebuffer
avoid_stencil_buffers
decode_encode_srgb_for_generatemipmap
disable_framebuffer_cmaa
disable_webgl_rgb_multisampling_usage
emulate_abs_int_function
get_frag_data_info_bug
init_two_cube_map_levels_before_copyteximage
msaa_is_slow
pack_parameters_workaround_with_pack_buffer
rebind_transform_feedback_before_resume
regenerate_struct_names
remove_invariant_and_centroid_for_essl3
reset_teximage2d_base_level
rewrite_texelfetchoffset_to_texelfetch
scalarize_vec_and_mat_constructor_args
set_zero_level_before_generating_mipmap
unfold_short_circuit_as_ternary_operation
unpack_alignment_workaround_with_unpack_buffer
unpack_image_height_workaround_with_unpack_buffer
use_intermediary_for_copy_texture_image
use_unused_standard_shared_blocks
Problems Detected
Unfold short circuit on Mac OS X: 307751
Applied Workarounds: unfold_short_circuit_as_ternary_operation
Always rewrite vec/mat constructors to be consistent: 398694
Applied Workarounds: scalarize_vec_and_mat_constructor_args
Mac drivers handle struct scopes incorrectly: 403957
Applied Workarounds: regenerate_struct_names
On Intel GPUs MSAA performance is not acceptable for GPU rasterization: 527565
Applied Workarounds: msaa_is_slow
glGenerateMipmap fails if the zero texture level is not set on some Mac drivers: 560499
Applied Workarounds: set_zero_level_before_generating_mipmap
Pack parameters work incorrectly with pack buffer bound: 563714
Applied Workarounds: pack_parameters_workaround_with_pack_buffer
Alignment works incorrectly with unpack buffer bound: 563714
Applied Workarounds: unpack_alignment_workaround_with_unpack_buffer
copyTexImage2D fails when reading from IOSurface on multiple GPU types.: 581777
Applied Workarounds: use_intermediary_for_copy_texture_image
Multisample renderbuffers with format GL_RGB8 have performance issues on Intel GPUs.: 607130
Applied Workarounds: disable_webgl_rgb_multisampling_usage
Use GL_INTEL_framebuffer_CMAA on ChromeOS: 535198
Applied Workarounds: disable_framebuffer_cmaa
glGetFragData{Location|Index} works incorrectly on Max: 638340
Applied Workarounds: get_frag_data_info_bug
glResumeTransformFeedback works incorrectly on Intel GPUs: 638514
Applied Workarounds: rebind_transform_feedback_before_resume
Result of abs(i) where i is an integer in vertex shader is wrong: 642227
Applied Workarounds: emulate_abs_int_function
Rewrite texelFetchOffset to texelFetch for Intel Mac: 642605
Applied Workarounds: rewrite_texelfetchoffset_to_texelfetch
Rewrite condition in for and while loops for Intel Mac: 644669
Applied Workarounds: add_and_true_to_loop_condition
Decode and encode before generateMipmap for srgb format textures on macosx: 634519
Applied Workarounds: decode_encode_srgb_for_generatemipmap
Init first two levels before CopyTexImage2D for cube map texture on Intel Mac 10.12: 648197
Applied Workarounds: init_two_cube_map_levels_before_copyteximage
Insert statements to reference all members in unused std140/shared blocks on Mac: 618464
Applied Workarounds: use_unused_standard_shared_blocks
Tex(Sub)Image3D performs incorrectly when uploading from unpack buffer with GL_UNPACK_IMAGE_HEIGHT greater than zero on Intel Macs: 654258
Applied Workarounds: unpack_image_height_workaround_with_unpack_buffer
adjust src/dst region if blitting pixels outside read framebuffer on Mac: 644740
Applied Workarounds: adjust_src_dst_region_for_blitframebuffer
Mac driver GL 4.1 requires invariant and centroid to match between shaders: 639760, 641129
Applied Workarounds: remove_invariant_and_centroid_for_essl3
Disable KHR_blend_equation_advanced until cc shaders are updated: 661715
Applied Workarounds: disable(GL_KHR_blend_equation_advanced), disable(GL_KHR_blend_equation_advanced_coherent)
Certain Apple devices leak stencil buffers: 713854
Applied Workarounds: avoid_stencil_buffers
Reset TexImage2D base level to 0 on Intel Mac 10.12.4: 705865
Applied Workarounds: reset_teximage2d_base_level
Version Information
Data exported	11/9/2017, 10:51:01 AM
Chrome version	Chrome/64.0.3263.0
Operating system	Mac OS X 10.13.2
Software rendering list URL	https://chromium.googlesource.com/chromium/src/+/fd1e89557fa78a467061f732a8473fd863a89b1a/gpu/config/software_rendering_list.json
Driver bug list URL	https://chromium.googlesource.com/chromium/src/+/fd1e89557fa78a467061f732a8473fd863a89b1a/gpu/config/gpu_driver_bug_list.json
ANGLE commit id	d80f2944cf13
2D graphics backend	Skia/64 065b41dd90782e22b5708c8b43696db641d54f46-
Command Line	/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary --flag-switches-begin --flag-switches-end
Driver Information
Initialization time	25
In-process GPU	false
Passthrough Command Decoder	false
Supports overlays	false
Sandboxed	true
GPU0	VENDOR = 0x1002, DEVICE= 0x6821
GPU1	VENDOR = 0x8086, DEVICE= 0x0d26 *ACTIVE*
Optimus	false
Optimus	false
AMD switchable	true
Driver vendor	
Driver version	10.30.10
Driver date	
Pixel shader version	4.10
Vertex shader version	4.10
Max. MSAA samples	8
Machine model name	MacBookPro
Machine model version	11.5
GL_VENDOR	Intel Inc.
GL_RENDERER	Intel Iris Pro OpenGL Engine
GL_VERSION	4.1 INTEL-10.30.10
GL_EXTENSIONS	GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier
Disabled Extensions	GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent
Window system binding vendor	
Window system binding version	
Window system binding extensions	
Direct rendering	Yes
Reset notification strategy	0x0000
GPU process crash count	0
Compositor Information
Tile Update Mode	Zero-copy
Partial Raster	Enabled
GpuMemoryBuffers Status
ATC	Software only
ATCIA	Software only
DXT1	Software only
DXT5	Software only
ETC1	Software only
R_8	GPU_READ, SCANOUT, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
R_16	Software only
RG_88	Software only
BGR_565	Software only
RGBA_4444	Software only
RGBX_8888	Software only
RGBA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE
BGRX_1010102	Software only
BGRA_8888	GPU_READ, SCANOUT, SCANOUT_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
RGBA_F16	GPU_READ, SCANOUT, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
YVU_420	Software only
YUV_420_BIPLANAR	GPU_READ, SCANOUT, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
UYVY_422	GPU_READ, SCANOUT, GPU_READ_CPU_READ_WRITE, GPU_READ_CPU_READ_WRITE_PERSISTENT
Display(s) Information
Info	Display[2077750397] bounds=0,0 1440x900, workarea=0,23 1440x805, scale=2, external
Color space information	{primaries:[[0.4443,0.3794,0.1404,],[0.2248,0.7262,0.0491,],[0.0055,0.0780,0.7415,],], transfer:0.0774*x + 0.0000 if x < 0.0404 else (0.9479*x + 0.0521)**2.4000 + 0.0000, matrix:RGB, range:FULL, icc_profile_id:10}
Bits per color component	8
Bits per pixel	24
Video Acceleration Information
Decode h264 baseline	up to 4096x2160 pixels
Decode h264 extended	up to 4096x2160 pixels
Decode h264 main	up to 4096x2160 pixels
Decode h264 high	up to 4096x2160 pixels
Encode h264 baseline	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 main	up to 4096x2160 pixels and/or 30.000 fps
Encode h264 high	up to 4096x2160 pixels and/or 30.000 fps
 

Comment 1 by kbr@chromium.org, Nov 9 2017

Managed to get a trace while this was happening. The Aquarium tab hung while gathering the trace. Clicking "Stop" caused both views to resume rendering. I don't see anything obviously suspicious in the trace. Will try to make this happen again but this time wait longer while both tabs aren't rendering.

trace_aquarium-hang.json.gz
1.7 MB Download

Comment 2 by kbr@chromium.org, Nov 9 2017

Another trace where rendering stopped for ~10 seconds before grabbing the trace. The hang doesn't seem to show up in the trace.

trace_aquarium-hang-10s.json.gz
4.5 MB Download

Comment 3 by kbr@chromium.org, Nov 9 2017

Cc: ccameron@chromium.org
Summary: WebGL Aquarium hangs with 25,000 fish on Canary on macOS (was: WebGL Aquarium hangs with 25,000 fish on Canary on macOS 10.13)
piman@ looked at the second trace in detail and found that at 1,884,400 µs there's a MessageLoop::RunTask call from here:

src_file	"../../extensions/browser/process_manager.cc"
src_func	"OnSuspendAck"

In response to that there is a trace event clearly showing the browser compositor being torn down:

Compositor::destructor	
LayerTreeHostInProcess::~LayerTreeHostInProcess	
SingleThreadProxy::stop	
LayerTreeHostImpl::ReleaseLayerTreeFrameSink	
GLES2::Finish	
CommandBufferHelper::Finish	
CommandBufferProxyImpl::WaitForGetOffset

I was able to reproduce this on 10.12 as well with a fresh user profile:

1. Start Chrome with --user-data-dir=/tmp/t1 (or some new user data dir)
2. Quickly navigate to the WebGL Aquarium and select 25,000 fish.
3. Try to open the Task Manager so you can watch the built-in extensions and background pages time out and exit after several seconds.

What seems to happen is that when a built-in extension exits, if the Aquarium is running with a lot of fish and therefore chewing up a lot of GPU time, a race condition is triggered and the browser's compositor is town down. I've seen this happen with the Chrome Web Store Payments Background Page and Chrome Media Router Extension. On 10.12 this happens intermittently but on 10.13 it happens frequently.

Comment 4 by kbr@chromium.org, Nov 9 2017

Summary: WebGL Aquarium hangs with 25,000 fish on macOS (was: WebGL Aquarium hangs with 25,000 fish on Canary on macOS)
This happens with top-of-tree Chromium as well as Chrome, when the built-in CryptoTokenExtension exits. That extension only seems to launch the first time a user profile is created, so it's necessary to specify --user-data-dir=/tmp/[new dir] every time to try to reproduce the bug. Navigate to the Aquarium, quickly select 25,000 fish, and see if the renderer hangs when that extension exits.

sounds similar to issue 781714 which is about a hang during browser shutdown in CommandBufferProxyImpl dtor.
Nvm my above comment. This seems to be because of the SetDeferCommits(true) call. It means that we stop updating ui compositor via begin main frame.

Comment 7 by kbr@chromium.org, Nov 9 2017

Owner: ccameron@chromium.org
Status: Assigned (was: Available)
Chris, you mentioned you could look into this if it were reproducible with Chromium; can I assign this to you?

Note that I'm having difficulty reproducing this on 10.12. Steps were:

1) Check out https://github.com/WebGLSamples/WebGLSamples.github.io/
2) From the checked-out directory, run:  python -m SimpleHTTPServer
3) Run:
rm -rf /tmp/t1 ; ./chrome-mac-515287/Chromium.app/Contents/MacOS/Chromium --user-data-dir=/tmp/t1 http://localhost:8000/aquarium/aquarium.html

When the CryptoTokenExtension exits, it doesn't seem to cause the aquarium to hang.

From offline discussion with kbr and ccameron, SetDeferCommits(true) is expected because the extension's ui compositor is suspended so that it can be recycled. We acquire a compositor lock on that ui compositor to prevent updates until it's recycled.
I see that the browser is continuing to call GLRenderer::SwapBuffers, so it looks as though it's not a scheduling bug.

To be 100% certain, we could enable tracing of ui and ensure that ui::AcceleratedWidgetMac::GotCALayerFrame or ui::AcceleratedWidgetMac::GotIOSurfaceFrame is being called after each swap.

If that call is not being made, then there may be a bug wherein GpuOutputSurfaceMac::OnGpuSwapBuffersCompleted thinks that it should not draw.

Comment 10 by kbr@chromium.org, Nov 10 2017

After rebooting the machine, this problem seemed to disappear, and I had some difficulty getting it to happen again. The reproduction steps above don't work reliably. Here are some which work almost 100% of the time. They have been tested on MacBook Pros with both AMD and NVIDIA GPUs on 10.12, so this issue isn't GPU dependent nor macOS 10.13 dependent.

0. Download this Chromium build, or use your own:
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac/515287/

1. Copy the URL into the clipboard:
https://webglsamples.org/aquarium/aquarium.html
2. Run Chrome/Chromium from the command line with a fresh user data directory, e.g.:
rm -rf /tmp/t1 ; ./chrome-mac-515287/Chromium.app/Contents/MacOS/Chromium --user-data-dir=/tmp/t1
3. Quickly paste the URL into the Omnibox.
4. As soon as the Aquarium loads, click the text for 30,000 fish.
5. Quickly open the Task Manager.
6. Wait for the CryptoTokenExtension to exit.

As soon as the CryptoTokenExtension exits, the window will frequently stop rendering. A locally hosted copy of the Aquarium would work too.

Passing the URL on the command line seems to cause the renderer for the Aquarium to initialize before those for the extensions, and when the extensions exit, the destruction of their compositors doesn't break the presentation of the Aquarium's frames.

Comment 11 by kbr@chromium.org, Nov 10 2017

Here is a trace gathered via the following command line options:

rm -rf /tmp/t1 ; ./chrome-mac-515287/Chromium.app/Contents/MacOS/Chromium --user-data-dir=/tmp/t1 --trace-startup=blink,cc,gpu,renderer.scheduler,ui,v8,toplevel --trace-startup-duration=20 --trace-startup-file=aquarium-hang.json

and following the steps above.

The MessageLoop::RunTask event posted which seems to trigger SingleThreadProxy::SetDeferCommits, and the destruction of the LayerTreeHostInProcess, happens at 15,443.794 ms.

aquarium-hang.json.gz
5.5 MB Download
We're continuing to get GLRenderer::SwapBuffers and ui::AcceleratedWidgetMac::GotCALayerFrame calls.

This indicates that everything is working perfectly in terms of compositor and scheduling -- frames are being produced and the browser is being told to put them on-screen.

I would guess this to be remote CoreAnimation hiccuping.

Comment 13 by kbr@chromium.org, Nov 10 2017

It seems more likely to me to be a compositor bookkeeping bug in Chrome. Starting the browser with the URL as argument seems to make the bug reliably go away. In this situation I think the renderer for the page is racily starting before the extensions' renderers, and when the extensions' renderers shut down, they aren't having the same effect on the UI compositor as when they start before the page's renderer.

Can we confirm or refute this hypothesis?

I tried running with various combinations of the flags:

--disable-remote-core-animation --disable-mac-overlays --disable-features=WebGLImageChromium

but the browser window renders black with --disable-remote-core-animation specified. Is there another way to confirm that the bug's related to usage of remote CA?

Looks like I broke --disable-remote-core-animation recently (oops, need to fix that).

I went back to 62.0.3202.94, where --disable-remote-core-animation still works and:
- this reproduces without --disable-remote-core-animation
- this does not reproduce with --disable-remote-core-animation

I'll go see if just re-creating our CALayerHost takes care of this.
One of my experiments here was to re-create the CALayerHost in the browser periodically. That did nothing.

Next experiment was to re-create the CAContext in the GPU process periodically. When I do that, the screen just turns black.

My feeling here is that the aquarium WebGL context is starving the ability of the GPU process to send new frames to the WindowServer.

The reason that the non-remote-layer path works, in this case, would be because it is the browser process that is sending new frames to the WindowServer (and is thus exempt from whatever throttling is being done).
My next experiment was to glFinish all GLContextCGLs whenever create or destroy a CAContext ... that didn't work.

Next attempt was to glFinish all GLContextCGLs every single frame ... that still doesn't fix anything.

It seems that this needs lots of breathing room. Of note is that clicking on any of the fish levels that brings the framerate back to 60hz fixes this immediately.

Comment 17 by kbr@chromium.org, Nov 16 2017

Thanks Chris for investigating this. Interesting that it really does seem to be in the Core Animation internals.

Right now DrawingBuffer calls DescheduleUntilFinishedCHROMIUM. Do you think it'd be feasible to plumb some signal through to prevent that from unblocking the WebGL context until say the first frame of a newly created UI compositor has hit the screen, or similar?

Have you figured out why this behavior's tied to the teardown of an extension?

> Have you figured out why this behavior's tied to the teardown of an extension?

Not yet. I've tried keeping the CAContexts and CALayers alive indefinitely on the GPU side, but the hang still occurs.

I've also just put a "glFinish the do a sleep for 10 msec" inside DescheduleUntilFinishedCHROMIUM, without luck.

So, I have a hunch that we're starving Cocoa's message loop here. Lemme see where I can get with that.
This is 100% a CPU-side scheduling/starvation issue.

I added a patch we make Scheduler::RunNextTask post its next task with a 1msec delay after every HandleDescheduleUntilFinishedCHROMIUM (coordinated just by a global variable).

With that change, the issue completely vanishes.

Ultimately we need the GPU scheduler to be running at a less-important priority than Cocoa. Cocoa has very few messages it runs in the GPU process, but it's important that they run with the most-important priority, because they are necessary to getting anything on-screen.

(this is the patch, btw)

diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 0a583f61ad66..97d19e953710 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -98,6 +98,8 @@
 #include "ui/gl/gpu_timing.h"
 #include "ui/gl/init/create_gr_gl_interface.h"
 
+bool g_let_me_breathe = false;
 #if defined(OS_MACOSX)
 #include <IOSurface/IOSurface.h>
 // Note that this must be included after gl_bindings.h to avoid conflicts.
@@ -16392,6 +16394,7 @@ bool GLES2DecoderImpl::CheckResetStatus() {
 error::Error GLES2DecoderImpl::HandleDescheduleUntilFinishedCHROMIUM(
     uint32_t immediate_data_size,
     const volatile void* cmd_data) {
+  g_let_me_breathe = true;
   if (!gl::GLFence::IsSupported())
     return error::kNoError;
   std::unique_ptr<gl::GLFence> fence(gl::GLFence::Create());
diff --git a/gpu/command_buffer/service/scheduler.cc b/gpu/command_buffer/service/scheduler.cc
index 1c75957e91d3..ac565c408655 100644
--- a/gpu/command_buffer/service/scheduler.cc
+++ b/gpu/command_buffer/service/scheduler.cc
@@ -15,6 +15,9 @@
 #include "base/trace_event/trace_event_argument.h"
 #include "gpu/command_buffer/service/sync_point_manager.h"
 
+extern bool g_let_me_breathe;
 namespace gpu {
 
 class Scheduler::Sequence {
@@ -560,8 +563,16 @@ void Scheduler::RunNextTask() {
     }
   }
 
-  task_runner_->PostTask(FROM_HERE, base::Bind(&Scheduler::RunNextTask,
-                                               weak_factory_.GetWeakPtr()));
+  if (g_let_me_breathe) {
+    g_let_me_breathe = false;
+    task_runner_->PostDelayedTask(FROM_HERE,
+        base::Bind(&Scheduler::RunNextTask, weak_factory_.GetWeakPtr()),
+        base::TimeDelta::FromMilliseconds(1));
+  } else {
+    task_runner_->PostTask(FROM_HERE, base::Bind(&Scheduler::RunNextTask,
+                                                 weak_factory_.GetWeakPtr()));
+  }
+
 }
 
 }  // namespace gpu
Cc: rsesek@chromium.org
Fortunately, rsesek has an explanation for this bug (thanks!):
https://bugs.chromium.org/p/chromium/issues/detail?id=312462#c51

> For context, on OS X there are four options for the main thread MessagePump:
> 1. Default
> 2. CFRunLoop
> 3. NSRunLoop
> 4. NSApplication
> 
> You may be able to get away with (2) if nothing requires NSTimer or
> -[NSObject performSelector:afterDelay:withObject:]. This was not the case in the renderers
> (scrollbars use NSTimer), so that's why renderer_main.cc allocates (3).

What we're running up against is consistent with remote CoreAnimation using one of those sorts of calls.
Project Member

Comment 22 by bugdroid1@chromium.org, Nov 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1732f2b0b33337ace603d3ec12f28cd3afaecda4

commit 1732f2b0b33337ace603d3ec12f28cd3afaecda4
Author: Christopher Cameron <ccameron@chromium.org>
Date: Fri Nov 17 10:56:50 2017

Use a NSRunLoop instead of a CFRunLoop in GpuMain

Under heavy CPU load, the GPU main thread was starving out messages
required by CoreAnimation.

Bug:  783298 
Change-Id: If3604b47e479e93b6351b816c17c7f570589ac22
Reviewed-on: https://chromium-review.googlesource.com/775621
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517365}
[modify] https://crrev.com/1732f2b0b33337ace603d3ec12f28cd3afaecda4/content/gpu/gpu_main.cc

Do you know what specific work was being starved by CFRunLoop? If you have a stack from the CoreAnimation work that wasn't getting processed but is after that change, I'd be curious.
Status: Fixed (was: Assigned)
Sending frames to the WindowServer was working fine (probably doesn't involve posting tasks) -- it seemed to be something related to destroying or disconnecting a CAContext in the browser process.

Comment 25 by kbr@chromium.org, Jan 20 2018

Blocking: 787189

Sign in to add a comment