Closed Bug 1925581 Opened 4 months ago Closed 4 months ago

Main thread allocation can block waiting for background free

Categories

(Core :: JavaScript: GC, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
133 Branch
Tracking Status
firefox133 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I noticed while profiling the browser that freeing empty arenas on the background thread can block allocating arenas on the main thread. Despite the fact that we periodically release the GC lock to allow the main thread to run, it seems as if the main thread isn't scheduled in time and the background thread takes the lock again and keeps running.

This affects the splay benchmark and presumably other cases of high allocation bandwidth.

This patch attempts to do more work to release empty arenas outside the GC lock
to allow the main thread to take the lock during perious of high allocator
throughput.

This has a large effect in local testing, improving splay and splay latency
scores by 4% and 21% respectively on macOS and by 4% and 6% on Linux. The
difference on try was much more moderate but it still showed some nice
improvements on jetstream2 on macOS.

Blocks: 1926228
Attachment #9431896 - Attachment description: Bug 1925581 - Move some work to release free areans outside of GC lock r?sfink → Bug 1925581 - Move some work to release free arenas outside of GC lock r?sfink
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b3cc2a726c49 Move some work to release free arenas outside of GC lock r=sfink
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch

4.8% improvement on AWFY-Jetstream2-splay-Average

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

Attachment

General

Created:
Updated:
Size: