Title: [276271] trunk/Source/WebKit
- Revision
- 276271
- Author
- [email protected]
- Date
- 2021-04-19 13:35:54 -0700 (Mon, 19 Apr 2021)
Log Message
MotionMark's Canvas-Arcs subtest is broken if the GPUProcess is not yet running
https://bugs.webkit.org/show_bug.cgi?id=224778
Reviewed by Simon Fraser.
I recently made changes so that the GPUProcess is only launched when it is needed. This means
that until MotionMark's Canvas-Arcs subtest, the GPUProcess is usually not yet running. As a
result, RemoteRenderingBackendProxy::createImageBuffer() ends up launching the GPUProcess
and sending the GPUConnectionToWebProcess::CreateRenderingBackend and
RemoteRenderingBackend::CreateImageBuffer IPC right away. We seem to have a synchronization
issue because when this happens, the rendering for the Canvas-Arcs subtest is visibly broken
and its score is very low (< 6, instead of > 600).
Making the GPUConnectionToWebProcess::CreateRenderingBackend synchronous again (I made it
async recently) seems to address the synchronization issue and restores correct behavior on
MotionMark. I am therefore making this IPC synchronous again in this patch to get benchmark
coverage again while I investigate the root cause offline.
* GPUProcess/GPUConnectionToWebProcess.cpp:
(WebKit::GPUConnectionToWebProcess::createRenderingBackend):
* GPUProcess/GPUConnectionToWebProcess.h:
* GPUProcess/GPUConnectionToWebProcess.messages.in:
* WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
(WebKit::RemoteRenderingBackendProxy::ensureGPUProcessConnection):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (276270 => 276271)
--- trunk/Source/WebKit/ChangeLog 2021-04-19 20:16:18 UTC (rev 276270)
+++ trunk/Source/WebKit/ChangeLog 2021-04-19 20:35:54 UTC (rev 276271)
@@ -1,5 +1,32 @@
2021-04-19 Chris Dumez <[email protected]>
+ MotionMark's Canvas-Arcs subtest is broken if the GPUProcess is not yet running
+ https://bugs.webkit.org/show_bug.cgi?id=224778
+
+ Reviewed by Simon Fraser.
+
+ I recently made changes so that the GPUProcess is only launched when it is needed. This means
+ that until MotionMark's Canvas-Arcs subtest, the GPUProcess is usually not yet running. As a
+ result, RemoteRenderingBackendProxy::createImageBuffer() ends up launching the GPUProcess
+ and sending the GPUConnectionToWebProcess::CreateRenderingBackend and
+ RemoteRenderingBackend::CreateImageBuffer IPC right away. We seem to have a synchronization
+ issue because when this happens, the rendering for the Canvas-Arcs subtest is visibly broken
+ and its score is very low (< 6, instead of > 600).
+
+ Making the GPUConnectionToWebProcess::CreateRenderingBackend synchronous again (I made it
+ async recently) seems to address the synchronization issue and restores correct behavior on
+ MotionMark. I am therefore making this IPC synchronous again in this patch to get benchmark
+ coverage again while I investigate the root cause offline.
+
+ * GPUProcess/GPUConnectionToWebProcess.cpp:
+ (WebKit::GPUConnectionToWebProcess::createRenderingBackend):
+ * GPUProcess/GPUConnectionToWebProcess.h:
+ * GPUProcess/GPUConnectionToWebProcess.messages.in:
+ * WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:
+ (WebKit::RemoteRenderingBackendProxy::ensureGPUProcessConnection):
+
+2021-04-19 Chris Dumez <[email protected]>
+
Fix races in LibWebRTCCodecs introduced in r276214
https://bugs.webkit.org/show_bug.cgi?id=224758
Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp (276270 => 276271)
--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp 2021-04-19 20:16:18 UTC (rev 276270)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp 2021-04-19 20:35:54 UTC (rev 276271)
@@ -409,12 +409,13 @@
}
#endif
-void GPUConnectionToWebProcess::createRenderingBackend(RemoteRenderingBackendCreationParameters&& creationParameters)
+void GPUConnectionToWebProcess::createRenderingBackend(RemoteRenderingBackendCreationParameters&& creationParameters, CompletionHandler<void()>&& completionHandler)
{
auto addResult = m_remoteRenderingBackendMap.ensure(creationParameters.identifier, [&]() {
return IPC::ScopedActiveMessageReceiveQueue { RemoteRenderingBackend::create(*this, WTFMove(creationParameters)) };
});
ASSERT_UNUSED(addResult, addResult.isNewEntry);
+ completionHandler();
}
void GPUConnectionToWebProcess::releaseRenderingBackend(RenderingBackendIdentifier renderingBackendIdentifier)
Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h (276270 => 276271)
--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h 2021-04-19 20:16:18 UTC (rev 276270)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h 2021-04-19 20:35:54 UTC (rev 276271)
@@ -163,7 +163,7 @@
RemoteMediaRecorderManager& mediaRecorderManager();
#endif
- void createRenderingBackend(RemoteRenderingBackendCreationParameters&&);
+ void createRenderingBackend(RemoteRenderingBackendCreationParameters&&, CompletionHandler<void()>&&);
void releaseRenderingBackend(RenderingBackendIdentifier);
#if ENABLE(WEBGL)
Modified: trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in (276270 => 276271)
--- trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in 2021-04-19 20:16:18 UTC (rev 276270)
+++ trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.messages.in 2021-04-19 20:35:54 UTC (rev 276271)
@@ -23,7 +23,7 @@
#if ENABLE(GPU_PROCESS)
messages -> GPUConnectionToWebProcess WantsDispatchMessage {
- void CreateRenderingBackend(struct WebKit::RemoteRenderingBackendCreationParameters creationParameters)
+ void CreateRenderingBackend(struct WebKit::RemoteRenderingBackendCreationParameters creationParameters) -> () Synchronous
void ReleaseRenderingBackend(WebKit::RenderingBackendIdentifier renderingBackendIdentifier)
#if ENABLE(WEBGL)
void CreateGraphicsContextGL(struct WebCore::GraphicsContextGLAttributes attributes, WebKit::GraphicsContextGLIdentifier graphicsContextGLIdentifier, WebKit::RenderingBackendIdentifier renderingBackendIdentifier, IPC::StreamConnectionBuffer stream)
Modified: trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp (276270 => 276271)
--- trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp 2021-04-19 20:16:18 UTC (rev 276270)
+++ trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp 2021-04-19 20:35:54 UTC (rev 276271)
@@ -75,7 +75,9 @@
auto& gpuProcessConnection = WebProcess::singleton().ensureGPUProcessConnection();
gpuProcessConnection.addClient(*this);
gpuProcessConnection.messageReceiverMap().addMessageReceiver(Messages::RemoteRenderingBackendProxy::messageReceiverName(), renderingBackendIdentifier().toUInt64(), *this);
- gpuProcessConnection.connection().send(Messages::GPUConnectionToWebProcess::CreateRenderingBackend(m_parameters), 0, IPC::SendOption::DispatchMessageEvenWhenWaitingForSyncReply);
+ // FIXME: This message shouldn't need to be synchronous (https://bugs.webkit.org/show_bug.cgi?id=224781).
+ // However, we seem to get in a bad state when this message is asynchronous and the GPUProcess has just launched.
+ gpuProcessConnection.connection().sendSync(Messages::GPUConnectionToWebProcess::CreateRenderingBackend(m_parameters), Messages::GPUConnectionToWebProcess::CreateRenderingBackend::Reply(), 0);
m_gpuProcessConnection = makeWeakPtr(gpuProcessConnection);
}
return *m_gpuProcessConnection;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes