Experiment with a custom allocator for the contents of the built frame
Categories
(Core :: Graphics: WebRender, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox132 | --- | fixed |
People
(Reporter: nical, Assigned: nical)
References
(Regressed 1 open bug)
Details
Attachments
(6 files, 1 obsolete file)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The goal is to avoid expensive allocations in the frame builder thread and expensive deallocations on the renderer thread when the built frame is dropped.
The idea is to use simple and fast bump allocators to for anything that is allocated on the render backend thread, sent to the renderer and have the same lifetime as the frame (all of them are dropped along with the frame).
There are a fair amount of other types of allocations on the render backend thread (mostly longer lived allocations that stay on the RB thread to describe retained state and cached). These will not be affected by this work.
The WIP prototype uses allocator_api2.
Assignee | ||
Comment 1•6 months ago
|
||
Assignee | ||
Comment 2•6 months ago
|
||
Assignee | ||
Comment 3•6 months ago
|
||
The safety of this allocator relies on it counting allocations and deallocations.
When the allocator is dropped or reset, the live allocation count is checked and failure to deallocate all live allocations in time crashes the process.
The allocator is created on the render backend thread, where allocations are made and sent along with the frame to the renderer thread where the frame is read. As soon as a new frame comes in to replace the current one, all of the current frame's allocations are dropped along with it. It is then safe to dispose of the allocator's memory or reset and reuse the allocator.
The allocator move between threads (along with its allocations) but is never used concurrently from multiple threads.
Depends on D218729
Assignee | ||
Comment 4•6 months ago
|
||
Depends on D219268
Assignee | ||
Comment 5•6 months ago
|
||
Attempting to use malloc_size_of with allocations that aren't directly backend by the global allocator crashes, so this commits compute the render task's report by in a more manual way.
In addition, add the allocator's memory footprint to memory reports.
Depends on D219269
Assignee | ||
Comment 6•6 months ago
|
||
Depends on D219270
Updated•6 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Assignee | ||
Comment 7•5 months ago
|
||
WebRender depends on allocator-api2 now.
Updated•5 months ago
|
Updated•5 months ago
|
Comment 9•4 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/3521a2abcbfb
https://hg.mozilla.org/mozilla-central/rev/f7a971f4161e
https://hg.mozilla.org/mozilla-central/rev/30c81d683bef
https://hg.mozilla.org/mozilla-central/rev/80057a2b320b
https://hg.mozilla.org/mozilla-central/rev/e3195c10d336
https://hg.mozilla.org/mozilla-central/rev/5c0408e2fee2
Description
•