Bug 91130 - [chromium] Fix initialization race to determine the initial memory limit
Summary: [chromium] Fix initialization race to determine the initial memory limit
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-12 11:56 PDT by Eric Penner
Modified: 2012-07-12 12:30 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Penner 2012-07-12 11:56:05 PDT
In LayerRendererChromium, we set the memory limit via a callback:

    if (m_capabilities.usingGpuMemoryManager)
        m_context->setMemoryAllocationChangedCallbackCHROMIUM(this);
    else
        m_context->m_client->setMemoryAllocationLimitBytes(some_default);

However, this leaves us with the question of what to do before we get the callback should we:
- Wait for the callback before rendering anything?
- Keep using a default a like we do currently?
- Use a synchronous call to get the limit rather than a callback? It could decide whether to block etc. or just return the default itself?


Another issue is that it is not effective to set the default in this location in LayerRendererChromium. Currently we also need
to set it in the CCLayerTreeHostImpl constructor, so our initialization in LayerRendererChromium is not early enough.
Comment 1 Dana Jansens 2012-07-12 11:58:38 PDT
Could we have a crbug for this? Manager peeps don't seem to watch w.b.o much.
Comment 2 Michal Mocny 2012-07-12 12:03:12 PDT
(In reply to comment #0)
> In LayerRendererChromium, we set the memory limit via a callback:
> 
>     if (m_capabilities.usingGpuMemoryManager)
>         m_context->setMemoryAllocationChangedCallbackCHROMIUM(this);
>     else
>         m_context->m_client->setMemoryAllocationLimitBytes(some_default);
> 
> However, this leaves us with the question of what to do before we get the callback should we:
> - Wait for the callback before rendering anything?
> - Keep using a default a like we do currently?
> - Use a synchronous call to get the limit rather than a callback? It could decide whether to block etc. or just return the default itself?
How is this functionally different from option 1?  The time to get an allocation is the same in both case, right?  Does initializing to 0 memory allocation somehow show us down?

> 
> 
> Another issue is that it is not effective to set the default in this location in LayerRendererChromium. Currently we also need
> to set it in the CCLayerTreeHostImpl constructor, so our initialization in LayerRendererChromium is not early enough.
Comment 3 Eric Penner 2012-07-12 12:16:33 PDT
(In reply to comment #2)
> (In reply to comment #0)
> > In LayerRendererChromium, we set the memory limit via a callback:
> > 
> >     if (m_capabilities.usingGpuMemoryManager)
> >         m_context->setMemoryAllocationChangedCallbackCHROMIUM(this);
> >     else
> >         m_context->m_client->setMemoryAllocationLimitBytes(some_default);
> > 
> > However, this leaves us with the question of what to do before we get the callback should we:
> > - Wait for the callback before rendering anything?
> > - Keep using a default a like we do currently?
> > - Use a synchronous call to get the limit rather than a callback? It could decide whether to block etc. or just return the default itself?
> How is this functionally different from option 1?  The time to get an allocation is the same in both case, right?  Does initializing to 0 memory allocation somehow show us down?

Just thinking out loud. It could hide the implementation and decision of whether to block and/or what default to give? Although the async way is likely preferred if we do always want to wait for a non-zero allocation.
Comment 4 Eric Penner 2012-07-12 12:30:26 PDT
Removing as this is now here:
https://code.google.com/p/chromium/issues/detail?id=137094