Closed Bug 1903977 Opened 2 years ago Closed 2 years ago

Reuse blob image tile buffers

Categories

(Core :: Graphics: WebRender, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox131 --- fixed

People

(Reporter: nical, Assigned: nical)

References

Details

Attachments

(1 file)

And make sure to deallocate the buffers on the thread that allocated them.

This should help a lot with reducing malloc contention. However since blob images can cause large allocation spikes, we have to be careful about releasing the memory eventually.

One way to go about this is to keep an Arc to the buffer on the worker thread that allocated. When we need a new buffer, traverse the list of allocated buffers and find one that has a refcount of 1, or allocate a new one. "Every now and then" (probably using a timer to schedule a task that happens once the scene builder hsa been idle for a couple of seconds), reduce the number of retained buffers.

The tile pool keeps a strong reference to all of its allocations and reuses them when their reference count gets down to one.
Jemalloc only uses thread-local arenas for small allocations (<496 bytes) so it does not matter what thread the blob tiles which are typically much larger, are deallocated in.

Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bd37586e34ed Add a blob tile pool. r=gfx-reviewers,gw

Backed out for causing WR bustages

Backout link

Push with failures

Failure log

Flags: needinfo?(nical.bugzilla)
Flags: needinfo?(nical.bugzilla)
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cac5254f4a00 Add a blob tile pool. r=gfx-reviewers,gw

Backed out for causing WR bustages

Backout link

Push with failures

Failure log

Flags: needinfo?(nical.bugzilla)
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4aa1704827b1 Add a blob tile pool. r=gfx-reviewers,gw
Flags: needinfo?(nical.bugzilla)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch

(In reply to Pulsebot from comment #6)

Pushed by nsilva@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4aa1704827b1
Add a blob tile pool. r=gfx-reviewers,gw

Perfherder has detected a talos performance change from push 4aa1704827b131756b1dac86994e6963a2ba144f.

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
6% tsvg_static linux1804-64-shippable-qr e10s fission stylo webrender 51.85 -> 48.74
5% tsvgx linux1804-64-shippable-qr e10s fission stylo webrender 237.60 -> 226.26
4% tsvgx linux1804-64-shippable-qr e10s fission stylo webrender 236.83 -> 226.68

Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.

If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a sheriff to do that for you.

You can run these tests on try with ./mach try perf --alert 1741

For more information on performance sheriffing please see our FAQ.

Regressions: 1912366
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: