Don't take the GC lock when unmarking arenas
Categories
(Core :: JavaScript: GC, enhancement, P3)
Tracking
()
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.
Assignee | ||
Comment 1•2 years ago
|
||
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.
Assignee | ||
Comment 2•2 years ago
|
||
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
Assignee | ||
Comment 3•2 years ago
|
||
We don't need the extra list any more since we can use collectingArenaLists instead.
Depends on D131722
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D131723
Assignee | ||
Comment 5•2 years ago
|
||
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
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/14183465e093
https://hg.mozilla.org/mozilla-central/rev/825fb218923b
https://hg.mozilla.org/mozilla-central/rev/772a8dab4a3a
https://hg.mozilla.org/mozilla-central/rev/e66130983de5
https://hg.mozilla.org/mozilla-central/rev/1da582103807
Description
•