Bug 234328

Summary: Twitter scroll stutter: ensure that CA backing store is always deallocated on the main thread
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: ScrollingAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarcelo, ews-watchlist, fred.wang, jamesr, luiz, simon.fraser, thorton, tonikitoo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
thorton: review+, ews-feeder: commit-queue-
Patch ews-feeder: commit-queue-

Simon Fraser (smfr)
Reported 2021-12-14 17:54:18 PST
Twitter scroll stutter: ensure that CA backing store is always deallocated on the main thread
Attachments
Patch (25.17 KB, patch)
2021-12-14 17:59 PST, Simon Fraser (smfr)
thorton: review+
ews-feeder: commit-queue-
Patch (25.18 KB, patch)
2021-12-14 21:20 PST, Simon Fraser (smfr)
ews-feeder: commit-queue-
Simon Fraser (smfr)
Comment 1 2021-12-14 17:59:45 PST
Simon Fraser (smfr)
Comment 2 2021-12-14 17:59:49 PST
Tim Horton
Comment 3 2021-12-14 19:45:00 PST
Comment on attachment 447186 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447186&action=review Not the least frightening patch I've ever seen. > Source/WebCore/WebCore.xcodeproj/project.pbxproj:-33104 > - 7B582DD82716F55B004B92D0 /* (null) in Headers */, This seems bad > Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerContentsDelayedReleaser.mm:82 > + RunLoop::main().dispatch([] { Isn't it the scrolling thread runloop you're racing here (freeing the transaction), not the main thread?
Simon Fraser (smfr)
Comment 4 2021-12-14 20:09:44 PST
Comment on attachment 447186 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447186&action=review >> Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerContentsDelayedReleaser.mm:82 >> + RunLoop::main().dispatch([] { > > Isn't it the scrolling thread runloop you're racing here (freeing the transaction), not the main thread? Probably, but we know we've exited the scrolling thread transaction (tho it may still be in the teardown phase), and we have a dispatch here so it should almost always win. I never saw us lose the race in practice. If we do, it's not the end of the world.
Simon Fraser (smfr)
Comment 5 2021-12-14 21:20:00 PST
EWS
Comment 6 2021-12-15 09:47:18 PST
Committed r287079 (?): <https://commits.webkit.org/r287079> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447201 [details].
Note You need to log in before you can comment on or make changes to this bug.