Bug 187866

Summary: Be more conservative with compositing layer creation when memory is low
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, ews-watchlist, koivisto, mjs, realdawei, rniwa, ryanhaddad, saam, simon.fraser, thorton, tsavell, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=188357
https://bugs.webkit.org/show_bug.cgi?id=188787
Attachments:
Description Flags
WIP Patch
none
Archive of layout-test-results from ews101 for mac-sierra
none
Archive of layout-test-results from ews104 for mac-sierra-wk2
none
Archive of layout-test-results from ews113 for mac-sierra
none
Patch zalan: review+

Simon Fraser (smfr)
Reported 2018-07-20 11:07:50 PDT
Be more conservative with compositing layer creation when memory is low
Attachments
WIP Patch (17.95 KB, patch)
2018-07-20 11:11 PDT, Simon Fraser (smfr)
no flags
Archive of layout-test-results from ews101 for mac-sierra (661.45 KB, application/zip)
2018-07-20 12:01 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (411.00 KB, application/zip)
2018-07-20 12:04 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-sierra (372.93 KB, application/zip)
2018-07-20 12:07 PDT, EWS Watchlist
no flags
Patch (33.82 KB, patch)
2018-07-25 21:53 PDT, Simon Fraser (smfr)
zalan: review+
Simon Fraser (smfr)
Comment 1 2018-07-20 11:11:08 PDT
Created attachment 345464 [details] WIP Patch
Simon Fraser (smfr)
Comment 2 2018-07-20 11:11:34 PDT
EWS Watchlist
Comment 3 2018-07-20 12:01:45 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 4 2018-07-20 12:01:47 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2018-07-20 12:04:22 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 6 2018-07-20 12:04:23 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2018-07-20 12:07:48 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 8 2018-07-20 12:07:49 PDT Comment hidden (obsolete)
Simon Fraser (smfr)
Comment 9 2018-07-25 21:53:06 PDT
Dean Jackson
Comment 10 2018-07-25 21:56:29 PDT
Comment on attachment 345821 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345821&action=review > Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h:51 > + bool isRepresentableIn2D() const final; why not inline?
Simon Fraser (smfr)
Comment 11 2018-07-25 22:03:41 PDT
(In reply to Dean Jackson from comment #10) > Comment on attachment 345821 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=345821&action=review > > > Source/WebCore/platform/graphics/transforms/Matrix3DTransformOperation.h:51 > > + bool isRepresentableIn2D() const final; > > why not inline? Virtual functions are never inlined by the compiler.
Maciej Stachowiak
Comment 12 2018-07-25 22:19:57 PDT
(In reply to Simon Fraser (smfr) from comment #11) > > Virtual functions are never inlined by the compiler. They can be inlined if the compiler can statically prove the exact type, which sometimes it can (not sure if that applies in this case(.
Saam Barati
Comment 13 2018-07-25 23:26:35 PDT
(In reply to Maciej Stachowiak from comment #12) > (In reply to Simon Fraser (smfr) from comment #11) > > > > Virtual functions are never inlined by the compiler. > > They can be inlined if the compiler can statically prove the exact type, > which sometimes it can (not sure if that applies in this case(. Right. I think a common case where this happens a lot is when a class is marked as final
zalan
Comment 14 2018-07-26 19:30:25 PDT
Comment on attachment 345821 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345821&action=review > Source/WebCore/rendering/RenderLayerCompositor.cpp:2458 > + if (!renderer.isCanvas()) is<RenderHTMLCanvas> > Source/WebCore/rendering/RenderLayerCompositor.cpp:2461 > + bool isCanvasLargeEnoughToForceCompositing = true; auto?
Simon Fraser (smfr)
Comment 15 2018-07-27 08:41:12 PDT
+ switch (m_compositingPolicy) { + case CompositingPolicy::Normal: + return renderer.style().transform().has3DOperation(); + case CompositingPolicy::Conservative: + // Continue to allow pages to avoid the very slow software filter path. + if (renderer.style().transform().has3DOperation() && renderer.hasFilter()) + return true; + return !renderer.style().transform().isRepresentableIn2D(); + }
Simon Fraser (smfr)
Comment 16 2018-07-27 15:20:51 PDT
Simon Fraser (smfr)
Comment 17 2018-07-28 08:46:26 PDT
I'm looking at the WK1 failures.
Simon Fraser (smfr)
Comment 18 2018-07-28 10:54:55 PDT
Followup in bug 188138.
Truitt Savell
Comment 19 2018-07-30 10:27:14 PDT
Simon Fraser (smfr)
Comment 20 2018-07-30 11:09:08 PDT
I will look (these may be expected).
Truitt Savell
Comment 21 2018-08-02 10:30:33 PDT
Do we have any timeframe on when these tests will be fixed or an update on what's happening?
Antti Koivisto
Comment 22 2018-08-06 11:09:57 PDT
Comment on attachment 345821 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=345821&action=review > Source/WebCore/page/Page.h:159 > + Conservative, // Used in low memory situations. "Conservative" is rather vague. How about just calling this CompositingPolicy::LowMemory? You can remove the comment too.
Truitt Savell
Comment 23 2018-09-04 16:19:48 PDT
I found that r234330 has also caused two tests to fail together: inspector/layers/layer-tree-manager.html inspector/layers/layers-anonymous.html Test history: https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=inspector%2Flayers%2Flayer-tree-manager.html%20inspector%2Flayers%2Flayers-anonymous.html These two tests will fail together often on High Sierra Leaks and sometimes on other WK1 builds. This is all tracked in https://bugs.webkit.org/show_bug.cgi?id=188394 I was able to find a reliable reproduction method and it looks like https://trac.webkit.org/changeset/234330/webkit is at fault.
Note You need to log in before you can comment on or make changes to this bug.