Bug 217112 - We should avoid making connections to the GPU Process during garbage collection
Summary: We should avoid making connections to the GPU Process during garbage collection
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-29 17:49 PDT by Wenson Hsieh
Modified: 2020-09-29 20:28 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.82 KB, patch)
2020-09-29 19:10 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2020-09-29 17:49:39 PDT
1   0x15e1a1779 WTFCrash
2   0x10f41d7cb WTFCrashWithInfo(int, char const*, char const*, int)
3   0x11093ae59 WTF::WeakPtr<WebKit::RemoteRenderingBackend, WTF::EmptyCounter>::operator->() const
4   0x11093b44a WebKit::RemoteImageBufferMessageHandler::waitForCreateImageBufferBackend()
5   0x110964340 WebKit::RemoteImageBuffer<WebKit::ImageBufferShareableIOSurfaceBackend>::ensureBackendCreated() const
6   0x10fa3493c WebCore::ConcreteImageBuffer<WebKit::ImageBufferShareableIOSurfaceBackend>::memoryCost() const
7   0x1430ace73 WebCore::CanvasBase::memoryCost() const
8   0x140b9cc5c WebCore::JSHTMLCanvasElement::visitChildren(JSC::JSCell*, JSC::SlotVisitor&)
9   0x15f3d4d64 JSC::SlotVisitor::visitChildren(JSC::JSCell const*)
10  0x15f3dc6ef JSC::SlotVisitor::drain(WTF::MonotonicTime)::$_3::operator()(JSC::MarkStackArray&) const
11  0x15f3d5294 JSC::IterationStatus JSC::SlotVisitor::forEachMarkStack<JSC::SlotVisitor::drain(WTF::MonotonicTime)::$_3>(JSC::SlotVisitor::drain(WTF::MonotonicTime)::$_3 const&)
12  0x15f3d521a JSC::SlotVisitor::drain(WTF::MonotonicTime)
13  0x15f3d5f77 JSC::SlotVisitor::drainFromShared(JSC::SlotVisitor::SharedDrainMode, WTF::MonotonicTime)
14  0x15f36d24b JSC::Heap::runBeginPhase(JSC::GCConductor)::$_19::operator()() const
15  0x15f36d0ae WTF::SharedTaskFunctor<void (), JSC::Heap::runBeginPhase(JSC::GCConductor)::$_19>::run()
16  0x15e227129 WTF::ParallelHelperClient::runTask(WTF::RefPtr<WTF::SharedTask<void ()>, WTF::DumbPtrTraits<WTF::SharedTask<void ()> >, WTF::DefaultRefDerefTraits<WTF::SharedTask<void ()> > > const&)
17  0x15e22825a WTF::ParallelHelperPool::Thread::work()
18  0x15e1b7913 WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0::operator()() const
19  0x15e1b74fe WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call()
20  0x15e1c9a22 WTF::Function<void ()>::operator()() const
21  0x15e279998 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*)
22  0x15e285a68 WTF::wtfThreadEntryPoint(void*)
23  0x7fff2030f9b4 _pthread_start
24  0x7fff2030b4d7 thread_start
Comment 1 Wenson Hsieh 2020-09-29 19:10:26 PDT
Created attachment 410086 [details]
Patch
Comment 2 Tim Horton 2020-09-29 19:45:42 PDT
Comment on attachment 410086 [details]
Patch

memoryCost() and externalMemoryCost() don't do IPC?

also, do we EVER need to make the backing store to answer this question? I'd expect us to know the size up front... I guess it's about IOSurface size rounding or complicated layouts?
Comment 3 Wenson Hsieh 2020-09-29 19:57:05 PDT
Thanks for the review!

(In reply to Tim Horton from comment #2)
> Comment on attachment 410086 [details]
> Patch
> 
> memoryCost() and externalMemoryCost() don't do IPC?

Yeah — from what I could gather, memoryCost() and externalMemoryCost() just ask the image buffer backend; however, in the process of creating the backend when using GPUP, we end up also establishing a connection to the GPUP 😬

> 
> also, do we EVER need to make the backing store to answer this question? I'd
> expect us to know the size up front... I guess it's about IOSurface size
> rounding or complicated layouts?

I think in theory, we shouldn’t; however, the ImageBufferBackend is the thing responsible for keeping track of sizes (and the thing that knows how to estimate memory cost).
Comment 4 EWS 2020-09-29 20:27:30 PDT
Committed r267780: <https://trac.webkit.org/changeset/267780>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 410086 [details].
Comment 5 Radar WebKit Bug Importer 2020-09-29 20:28:16 PDT
<rdar://problem/69775393>