Closed Bug 1742127 Opened 2 years ago Closed 2 years ago

Don't take the GC lock when unmarking arenas

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(5 files)

Looking at a profile I saw there can be a lot of lock contention between the background unmarking task and the main thread, if the main thread is allocating heavily.

We should move the arenas to be unmarked to a separate data structure so that we don't need to lock when accessing it off-thread.

The idea is to have two sets of arena list per zone, one for arenas that are
being operated on by the GC and the main one where any new arenas are
allocated.

Currently we switch to storing new arenas in a separate set of lists during the
mark phase. This changes that to move the existing arenas to the new set of
lists at the start of marking, which means we always allocate in the main set.

Depends on D131721

We don't need the extra list any more since we can use collectingArenaLists instead.

Depends on D131722

This was used to make sure we took the lock during allocation, but it uses a
different set of arena lists now so this isn't required.

Depends on D131724

Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/14183465e093
Part 1: Add separate arena lists for arenas that are being collected r=sfink
https://hg.mozilla.org/integration/autoland/rev/825fb218923b
Part 2: Use collecting arena lists to replace newArenasInMarkPhase r=sfink
https://hg.mozilla.org/integration/autoland/rev/772a8dab4a3a
Part 3: Sweep from collecting arena lists and remove arenasToSweep r=sfink
https://hg.mozilla.org/integration/autoland/rev/e66130983de5
Part 4: Use collecting arena lists to unmark arenas without required the GC lock r=sfink
https://hg.mozilla.org/integration/autoland/rev/1da582103807
Part 5: Remove concurrent use enum for arena unmarking now lock is no longer required r=sfink
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: