Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markAllBackingStoreVolatileFromTimer can stop the volatility timer too soon and not mark all surfaces as volatile. #20014

Merged

Conversation

mattwoodrow
Copy link
Contributor

@mattwoodrow mattwoodrow commented Nov 5, 2023

a6666b9

markAllBackingStoreVolatileFromTimer can stop the volatility timer too soon and not mark all surfaces as volatile.
https://bugs.webkit.org/show_bug.cgi?id=264229
<rdar://116711724>

Reviewed by Simon Fraser.

RemoteLayerWithRemoteRenderingBackingStoreCollection::markAllBackingStoreVolatileFromTimer stops the volatility timer if the operation is successful, since there should be no further backing stores to mark volatile.

This is an async operation though, and it's possible for markBackingStoreVolatileAfterReachabilityChange to have been called in the interim and there are now new backing stores that aren't yet volatile.

This change ensures that we reschedule the volatility timer if any markBackingStoreVolatileAfterReachabilityChange don't succesfully mark the relevant surfaces as volatile.

* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm:
(WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::markBackingStoreVolatileAfterReachabilityChange):

Canonical link: https://commits.webkit.org/270486@main

ee92e02

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@mattwoodrow mattwoodrow self-assigned this Nov 5, 2023
@mattwoodrow mattwoodrow added the Layout and Rendering For bugs with layout and rendering of Web pages. label Nov 5, 2023
LOG_WITH_STREAM(RemoteLayerBuffers, stream << "RemoteLayerWithRemoteRenderingBackingStoreCollection::markBackingStoreVolatileAfterReachabilityChange - succeeded " << succeeded);
if (!succeeded && weakThis)
weakThis->scheduleVolatilityTimer();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some risk that we never succeed and keep scheduling this timer forever?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that risk is existing, the volatility timer is repeating, and it's only the successful marking of all surfaces that explicitly stops it.

@mattwoodrow mattwoodrow added the merge-queue Applied to send a pull request to merge-queue label Nov 6, 2023
@webkit-commit-queue
Copy link
Collaborator

Commit message contains (OOPS!) and no reviewer found, blocking PR #20014

@webkit-commit-queue webkit-commit-queue added merging-blocked Applied to prevent a change from being merged and removed merge-queue Applied to send a pull request to merge-queue labels Nov 6, 2023
@mattwoodrow mattwoodrow requested a review from smfr November 7, 2023 02:18
@mattwoodrow mattwoodrow added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Nov 9, 2023
…o soon and not mark all surfaces as volatile.

https://bugs.webkit.org/show_bug.cgi?id=264229
<rdar://116711724>

Reviewed by Simon Fraser.

RemoteLayerWithRemoteRenderingBackingStoreCollection::markAllBackingStoreVolatileFromTimer stops the volatility timer if the operation is successful, since there should be no further backing stores to mark volatile.

This is an async operation though, and it's possible for markBackingStoreVolatileAfterReachabilityChange to have been called in the interim and there are now new backing stores that aren't yet volatile.

This change ensures that we reschedule the volatility timer if any markBackingStoreVolatileAfterReachabilityChange don't succesfully mark the relevant surfaces as volatile.

* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerWithRemoteRenderingBackingStoreCollection.mm:
(WebKit::RemoteLayerWithRemoteRenderingBackingStoreCollection::markBackingStoreVolatileAfterReachabilityChange):

Canonical link: https://commits.webkit.org/270486@main
@webkit-commit-queue
Copy link
Collaborator

Committed 270486@main (a6666b9): https://commits.webkit.org/270486@main

Reviewed commits have been landed. Closing PR #20014 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit a6666b9 into WebKit:main Nov 9, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants