Closed Bug 1691703 Opened 4 years ago Closed 4 years ago

Splay benchmark triggers lots of GC slices during the prepare phase

Categories

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

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(2 files)

While testing other changes I noticed that we trigger a lot (~30) slices during the prepare phase of GC, while we're waiting for background unmarking to finish. We're triggering one for every arena allocated after we pass the initial threshold for triggering a GC.

These slices won't do anything so this is wasteful.

Conversely, there are extra checks in GCRuntime::checkHeapThreshold so we don't trigger slices when we're waiting for background finalization or decommit.

In both cases we should be able to set the slice threshold so that slices are only triggered for every MB of allocation. This would stop us triggering a slice per arena in the prepare phase and let us simplify the threshold check (at the cost of an empty GC slice every MB of allocation in this situation).

Zone start thresholds are only set when we start the collection itself, when the prepare phase has finished. It doesn't matter if we set slice thresholds independetly of these and it means that we can limit GC slices in the prepare phase to one per MB of allocation.

This removes the check that stops us alloc triggering slices when we're background sweeping or decommitting. Unless we've hit the incremental limit, such slices will exit without doing any work (as there's nothing to do but wait) and are pointless, but this allows us to simplify the threshold check logic. Slices like this are only trigger once per MB of data allocated so this extra execution is negligable.

Depends on D104665

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2e9ccb2af815 Set zone slices thresholds at start of prepare phase, independently of zone start thresholds r=sfink https://hg.mozilla.org/integration/autoland/rev/f6152e743c40 Simplify heap threshold check r=sfink
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: