WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
227791
[GPU Process] Regulate the WebPage RenderingUpdates from the WebProcess to the GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=227791
Summary
[GPU Process] Regulate the WebPage RenderingUpdates from the WebProcess to th...
Said Abou-Hallawa
Reported
2021-07-07 23:18:44 PDT
Although RemoteRenderingBackend::stopListeningForIPC() removes its m_workQueue from the connection WorkQueueMessageReceiver HashMap, m_workQueue can still process accumulated received messages. Removing WorkQueueMessageReceiver will call the destructor ~WorkQueueMessageReceiver but the m_queue of the deleted object can still be running. The reason is the lambda of the WorkQueue::dispatch() in WorkQueueMessageReceiverQueue::enqueueMessage() captures the receiver which is RemoteRenderingBackend as a Ref pointer. Because RemoteRenderingBackend holds the last reference to WorkQueue, m_workQueue can run even after RemoteRenderingBackend::stopListeningForIPC() is called.
Attachments
Patch
(4.93 KB, patch)
2021-07-07 23:59 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(4.92 KB, patch)
2021-07-08 00:20 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(20.70 KB, patch)
2021-07-15 01:33 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(22.33 KB, patch)
2021-07-15 13:29 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch for EWS
(26.63 KB, patch)
2021-07-17 02:02 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch for EWS
(24.54 KB, patch)
2021-07-18 02:07 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(25.74 KB, patch)
2021-07-18 23:35 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(21.16 KB, patch)
2021-07-19 11:52 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(39.82 KB, patch)
2021-07-20 02:14 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(40.06 KB, patch)
2021-07-21 20:26 PDT
,
Said Abou-Hallawa
no flags
Details
Formatted Diff
Diff
Patch
(40.22 KB, patch)
2021-07-26 12:40 PDT
,
Said Abou-Hallawa
simon.fraser
: review+
Details
Formatted Diff
Diff
Patch
(40.51 KB, patch)
2021-07-26 16:20 PDT
,
Said Abou-Hallawa
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(40.64 KB, patch)
2021-07-26 20:24 PDT
,
Said Abou-Hallawa
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(11)
View All
Add attachment
proposed patch, testcase, etc.
Said Abou-Hallawa
Comment 1
2021-07-07 23:19:52 PDT
<
rdar://78430639
>
Said Abou-Hallawa
Comment 2
2021-07-07 23:59:06 PDT
Created
attachment 433122
[details]
Patch
Said Abou-Hallawa
Comment 3
2021-07-08 00:20:27 PDT
Created
attachment 433124
[details]
Patch
Simon Fraser (smfr)
Comment 4
2021-07-08 13:54:58 PDT
This does not fix the "navigating away from the page" case. What's the plan for that?
Simon Fraser (smfr)
Comment 5
2021-07-09 10:33:07 PDT
Comment on
attachment 433124
[details]
Patch r- pending an answer to the question
Said Abou-Hallawa
Comment 6
2021-07-15 01:33:32 PDT
Created
attachment 433568
[details]
Patch Patch for EWS
Said Abou-Hallawa
Comment 7
2021-07-15 13:29:33 PDT
Created
attachment 433620
[details]
Patch Patch for EWS
Said Abou-Hallawa
Comment 8
2021-07-17 02:02:52 PDT
Created
attachment 433729
[details]
Patch for EWS
Said Abou-Hallawa
Comment 9
2021-07-18 02:07:14 PDT
Created
attachment 433746
[details]
Patch for EWS
Said Abou-Hallawa
Comment 10
2021-07-18 23:35:10 PDT
Created
attachment 433771
[details]
Patch
Sam Weinig
Comment 11
2021-07-19 09:38:35 PDT
Comment on
attachment 433771
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=433771&action=review
> Tools/WebKitTestRunner/TestOptions.cpp:124 > + { "RenderingUpdateRegulateEnabled", false },
This should not be needed.
Sam Weinig
Comment 12
2021-07-19 09:38:37 PDT
Comment on
attachment 433771
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=433771&action=review
> Tools/WebKitTestRunner/TestOptions.cpp:124 > + { "RenderingUpdateRegulateEnabled", false },
This should not be needed.
Said Abou-Hallawa
Comment 13
2021-07-19 11:52:30 PDT
Created
attachment 433805
[details]
Patch
Simon Fraser (smfr)
Comment 14
2021-07-19 14:43:24 PDT
Comment on
attachment 433805
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=433805&action=review
> Source/WebCore/page/RenderingUpdateScheduler.h:70 > + unsigned m_rescheduledRenderingUpdates { 0 };
m_rescheduledRenderingUpdateCount Move it up before the bools to optimize padding.
> Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:293 > + m_didFinalizeRenderingUpdateVersion = std::min(didFinalizeRenderingUpdateVersion, m_finalizeRenderingUpdateVersion);
Isn't it a bug if didFinalizeRenderingUpdateVersion and m_finalizeRenderingUpdateVersion are out of order?
> Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:158 > + uint64_t m_finalizeRenderingUpdateVersion { 1 }; > + uint64_t m_didFinalizeRenderingUpdateVersion { 1 };
I think these should be a type defined as MonotonicObjectIdentifier<>. Can one be named as "last completed" or something? This is closer to the naming we use for TransactionIDs.
Said Abou-Hallawa
Comment 15
2021-07-20 02:14:18 PDT
Created
attachment 433861
[details]
Patch
Said Abou-Hallawa
Comment 16
2021-07-21 20:26:46 PDT
Created
attachment 433985
[details]
Patch
Said Abou-Hallawa
Comment 17
2021-07-21 20:34:08 PDT
Comment on
attachment 433805
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=433805&action=review
>> Source/WebCore/page/RenderingUpdateScheduler.h:70 >> + unsigned m_rescheduledRenderingUpdates { 0 }; > > m_rescheduledRenderingUpdateCount > > Move it up before the bools to optimize padding.
Done.
>> Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.cpp:293 >> + m_didFinalizeRenderingUpdateVersion = std::min(didFinalizeRenderingUpdateVersion, m_finalizeRenderingUpdateVersion); > > Isn't it a bug if didFinalizeRenderingUpdateVersion and m_finalizeRenderingUpdateVersion are out of order?
Yes it is a bug if we are the only who sends didFinalizeRenderingUpdateVersion larger than m_finalizeRenderingUpdateVersion. And this is why I added the debug ASSERT above. But if the argument of the IPC message RemoteRenderingBackendProxy::DidFinalizeRenderingUpdate was altered when sending it from GPUProcess to WebProcess, I thought we can protect ourselves from this underflow if we just use std::min(). unsigned delayedRenderingUpdates() const { return m_finalizeRenderingUpdateVersion - m_didFinalizeRenderingUpdateVersion; }
>> Source/WebKit/WebProcess/GPU/graphics/RemoteRenderingBackendProxy.h:158 >> + uint64_t m_didFinalizeRenderingUpdateVersion { 1 }; > > I think these should be a type defined as MonotonicObjectIdentifier<>. > > Can one be named as "last completed" or something? This is closer to the naming we use for TransactionIDs.
Done.
Said Abou-Hallawa
Comment 18
2021-07-26 12:40:44 PDT
Created
attachment 434227
[details]
Patch
Simon Fraser (smfr)
Comment 19
2021-07-26 14:49:59 PDT
Comment on
attachment 434227
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=434227&action=review
> Source/WebCore/ChangeLog:12 > + certain number of rescheduling.
reschedules
> Source/WebKit/Shared/MonotonicObjectIdentifier.h:129 > +template<typename T> > +inline unsigned operator-(const MonotonicObjectIdentifier<T>& a, const MonotonicObjectIdentifier<T>& b) > +{ > + return a.toUInt64() - b.toUInt64(); > +}
I think this needs to return a signed Int64 value to avoid mistakes.
> Source/WebKit/WebProcess/WebPage/WebPage.h:402 > + bool canTriggerRenderingUpdate(unsigned rescheduledRenderingUpdateCount) const;
canTriggerRenderingUpdate -> shouldTriggerRenderingUpdate
Chris Dumez
Comment 20
2021-07-26 14:52:36 PDT
Comment on
attachment 434227
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=434227&action=review
> Source/WebKit/Shared/MonotonicObjectIdentifier.h:35 > +template<typename T> class MonotonicObjectIdentifier {
I think this could use a comment to explain its purpose and how it differs from ObjectIdentifier. Isn't an ObjectIdentifier monotonic? It definitely can only increment.
Said Abou-Hallawa
Comment 21
2021-07-26 16:20:14 PDT
Created
attachment 434253
[details]
Patch
Said Abou-Hallawa
Comment 22
2021-07-26 18:35:05 PDT
Comment on
attachment 434227
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=434227&action=review
>> Source/WebCore/ChangeLog:12 >> + certain number of rescheduling. > > reschedules
Fixed.
>> Source/WebKit/Shared/MonotonicObjectIdentifier.h:35 >> +template<typename T> class MonotonicObjectIdentifier { > > I think this could use a comment to explain its purpose and how it differs from ObjectIdentifier. Isn't an ObjectIdentifier monotonic? It definitely can only increment.
I added a comment describing the difference between the two and a FIXME suggesting merging them.
>> Source/WebKit/Shared/MonotonicObjectIdentifier.h:129 >> +} > > I think this needs to return a signed Int64 value to avoid mistakes.
Done. I added a Checked calculation to deal with the overflow.
>> Source/WebKit/WebProcess/WebPage/WebPage.h:402 >> + bool canTriggerRenderingUpdate(unsigned rescheduledRenderingUpdateCount) const; > > canTriggerRenderingUpdate -> shouldTriggerRenderingUpdate
Fixed.
EWS
Comment 23
2021-07-26 19:03:48 PDT
Tools/Scripts/svn-apply failed to apply
attachment 434253
[details]
to trunk. Please resolve the conflicts and upload a new patch.
Said Abou-Hallawa
Comment 24
2021-07-26 20:24:12 PDT
Created
attachment 434265
[details]
Patch
EWS
Comment 25
2021-07-26 21:43:04 PDT
Committed
r280337
(
239984@main
): <
https://commits.webkit.org/239984@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 434265
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug