Closed Bug 1677765 Opened 4 years ago Closed 3 years ago

Unmark arenas concurrently with mutator at the start of GC

Categories

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

enhancement

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file, 1 obsolete file)

As discussed in bug 1661872, we should be able to unmark GC things concurrently with the mutator at the start of GC. This means that the true start of GC would be in a second (or later slice) when we mark the roots, with previous slices setting up and polling for background unmarking work to finish.

This can be done concurrently? Oh... the mark bits are atomic now!

This adds a new background task for unmarking which gets kicked off in the
first GC slice. There's a new explicit 'prepare' state for both the GCRuntime
and zones. The GC proper starts in a second (or later) slice when this has
finished. Because of this we have to be a bit careful when checking GC
state because the 'prepare' state is not part of the GC from the point of view
of snapshot-at-the-beginning.

I had to update a bunch of test code that assumed that GC started in the mark
state.

Severity: -- → N/A
Priority: -- → P3
Depends on: 1681268

This adds a new background task for unmarking which gets kicked off in the
first GC slice. There's a new explicit 'prepare' state for both the GCRuntime
and zones. The GC proper starts in a second (or later) slice when this has
finished. Because of this we have to be a bit careful when checking GC
state because the 'prepare' state is not part of the GC from the point of view
of snapshot-at-the-beginning.

I had to update a bunch of test code that assumed that GC started in the mark
state.

This fixes cancelleling a parallel task in the case that the task was idle so
that it doesn't leave the cancel flag set.

Also it stops us sending telemetry about how much was collected in GCs that
were reset as we don't always have the data for the original heap sizes by this
point if the reset happened while we were in the prepare phase.

Finally there's a new zeal mode to test this, named YieldBeforeRootMarking
(slightly confusing but in line with the other modes).

Attachment #9191915 - Attachment is obsolete: true
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b4072f201205
Perform arena unmarking concurrently r=sfink
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/03e46a1ed9c1
Perform arena unmarking concurrently r=sfink
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Regressions: 1683149
Regressions: 1683894
Regressions: 1683903
Regressions: 1683301
Flags: needinfo?(jcoppeard)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: