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

Issue 782583003: List sync points to wait on in AsyncFlush message

Created:
6 years ago by jbauman
Modified:
6 years ago
Reviewers:
no sievers
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, jam, sievers+watch_chromium.org, jbauman+watch_chromium.org, darin-cc_chromium.org, kalyank, mkwst+moarreviews-renderer_chromium.org, piman+watch_chromium.org, danakj+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

List sync points to wait on in AsyncFlush message This patch puts a vector of sync points to wait on in the AsyncFlush message, instead of embedding them in the command buffer. This allows the code to ensure the sync points have been inserted before they're waited on, which avoids a deadlock. This may also reduce the number of glmakecurrent calls that happen, because it can now wait for all the dependencies of a set of commands to execute before making the context current. BUG=373452

Patch Set 1 #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+214 lines, -225 lines) Patch
M content/common/gpu/client/command_buffer_proxy_impl.h View 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/client/command_buffer_proxy_impl.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M content/common/gpu/gpu_channel.cc View 2 chunks +66 lines, -39 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.h View 2 chunks +4 lines, -2 lines 0 comments Download
M content/common/gpu/gpu_command_buffer_stub.cc View 1 9 chunks +15 lines, -15 lines 0 comments Download
M content/common/gpu/gpu_messages.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/pepper/ppb_graphics_3d_impl.h View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/pepper/ppb_graphics_3d_impl.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/build_gles2_cmd_buffer.py View 1 chunk +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/client/client_test_helper.h View 3 chunks +5 lines, -3 lines 0 comments Download
M gpu/command_buffer/client/client_test_helper.cc View 3 chunks +8 lines, -6 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper.h View 2 chunks +6 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper.cc View 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/client/cmd_buffer_helper_test.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M gpu/command_buffer/client/gles2_cmd_helper_autogen.h View 1 chunk +0 lines, -8 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_impl_autogen.h View 1 chunk +0 lines, -8 lines 0 comments Download
M gpu/command_buffer/client/gles2_implementation_unittest_autogen.h View 1 chunk +1 line, -11 lines 0 comments Download
M gpu/command_buffer/client/transfer_buffer_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/common/command_buffer.h View 1 chunk +4 lines, -2 lines 0 comments Download
M gpu/command_buffer/common/command_buffer_mock.h View 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_autogen.h View 1 chunk +0 lines, -33 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_format_test_autogen.h View 1 chunk +0 lines, -11 lines 0 comments Download
M gpu/command_buffer/common/gles2_cmd_ids_autogen.h View 1 chunk +6 lines, -7 lines 0 comments Download
M gpu/command_buffer/service/command_buffer_service.h View 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/command_buffer_service.cc View 1 chunk +2 lines, -1 line 0 comments Download
M gpu/command_buffer/service/command_buffer_service_unittest.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.h View 2 chunks +0 lines, -6 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder.cc View 1 5 chunks +1 line, -21 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_mock.h View 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h View 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.h View 2 chunks +3 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/in_process_command_buffer.cc View 6 chunks +24 lines, -9 lines 0 comments Download
M gpu/command_buffer/service/sync_point_manager.h View 1 chunk +2 lines, -0 lines 0 comments Download
M gpu/command_buffer/service/sync_point_manager.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M ppapi/proxy/ppapi_command_buffer_proxy.h View 1 chunk +2 lines, -1 line 0 comments Download
M ppapi/proxy/ppapi_command_buffer_proxy.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppapi_messages.h View 1 chunk +3 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_graphics_3d_proxy.h View 2 chunks +5 lines, -2 lines 0 comments Download
M ppapi/proxy/ppb_graphics_3d_proxy.cc View 2 chunks +7 lines, -4 lines 0 comments Download
M ppapi/thunk/ppb_graphics_3d_api.h View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 8 (1 generated)
jbauman
6 years ago (2014-12-05 01:23:38 UTC) #2
no sievers
To fix the security issue couldn't we just detect the bad pattern entirely from the ...
6 years ago (2014-12-05 20:35:07 UTC) #3
jbauman
On 2014/12/05 20:35:07, sievers wrote: > To fix the security issue couldn't we just detect ...
6 years ago (2014-12-05 23:34:02 UTC) #4
no sievers
I meant that not inlining glWaitSyncPoint() also hurts this use case (and it's not very ...
6 years ago (2014-12-06 00:04:05 UTC) #5
no sievers
On 2014/12/06 00:04:05, sievers wrote: > I meant that not inlining glWaitSyncPoint() also hurts this ...
6 years ago (2014-12-06 00:05:10 UTC) #6
jbauman
On 2014/12/06 00:05:10, sievers wrote: > On 2014/12/06 00:04:05, sievers wrote: > > I meant ...
6 years ago (2014-12-06 00:13:22 UTC) #7
no sievers
6 years ago (2014-12-08 21:21:32 UTC) #8
On 2014/12/06 00:13:22, jbauman wrote:
> On 2014/12/06 00:05:10, sievers wrote:
> > On 2014/12/06 00:04:05, sievers wrote:
> > > I meant that not inlining glWaitSyncPoint() also hurts this use case (and
> it's
> > > not very obvious.. the fact that it's not inline essentially):
> > > 
> > > glDrawSomething()
> > > glWaitSyncPoint(N)
> > > glDoSomethingElseWithDependency()
> > > 
> > > Now glDrawSomething gets delayed according to the dependency it does not
> have.
> > > The client would have to explicitly Flush after the Draw.
> > 
> > plus we mostly try to minimize flushes in the critical path because of the
IPC
> > delay.
> 
> glDrawSomething() gets delayed, but whatever command buffer stub
> glRetireSyncPoint(N) is executing on gets to go instead (ignoring other
> SetScheduled(false), which never happen anymore). And since it's currently
> essentially random which command buffer starts executing first, that doesn't
> seem like an issue to me.

Ok, letting the service know about the dependencies definitely seems useful.
How would you feel about getting the best of both worlds and keeping the current
in-line sync-points for hard dependencies, the way they work now by
descheduling, and adding an up-front list of dependencies with the Flush like in
your patch, but using it for preemption (rather than descheduling decisions)?

That way a cmdbuffer with dependencies could still start running if there are no
other clients with work. We could also get fancier later and resolve
dependencies and schedule in the best order.

Powered by Google App Engine
This is Rietveld 408576698