Closed Bug 1816340 Opened 2 years ago Closed 2 years ago

Emergency GCs should wait for background free

Categories

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

task

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: pbone, Assigned: pbone)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files, 1 obsolete file)

I was looking at AWSY results and thought I saw a problem with the measurements taken after a GC. I was concerned that the GC doesn't wait for the free task to finish and the measurement can race with the free task. Free tasks are usually started by minor GCs but can also be started after sweeping. I wrote some patches to investigate and found that they made no difference to AWSY results, however they may still be a good idea since they should free more memory synchronously for emergency GCs.

AWSY results: https://treeherder.mozilla.org/perfherder/compare?originalProject=try&originalRevision=13649bc3dfdb3c1ab04a6e72405b0cc9f33e5994&newProject=try&newRevision=f783c181d6cd6f10e3d7c09679697ad6363fe8c6&framework=4&page=1&showOnlyComparable=1

The purgeRuntime() call can add lifo blocks to be freed by the free task.
So we should start the free task after adding this call so it has a
better chance of freeing all the lifo blocks.

Depends on D169579

Do any off-thread freeing work created by sweeping on the main thread during
non-incremental GCs, to ensure that the work completes by the end of the GC.

Depends on D169580

Depends on D169581

Blocks: 1814815
Blocks: GC
Severity: -- → N/A
Priority: -- → P1
Attachment #9317253 - Attachment is obsolete: true
Attachment #9317254 - Attachment description: Bug 1816340 - pt 3. Start background free after purge r=jonco → Bug 1816340 - pt 2. Start background free after purge r=jonco
Attachment #9317255 - Attachment description: Bug 1816340 - pt 4. Free on main thread for non-incremental GCs r=jonco → Bug 1816340 - pt 3. Free on main thread for non-incremental GCs r=jonco
Attachment #9317256 - Attachment description: Bug 1816340 - pt 5. Delete some dead code r=jonco → Bug 1816340 - pt 4. Delete some dead code r=jonco
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0618800d5910 pt 1. Add a locked version of runFromMainThread() r=jonco https://hg.mozilla.org/integration/autoland/rev/709c4be1e56f pt 2. Start background free after purge r=jonco https://hg.mozilla.org/integration/autoland/rev/b32dfa568997 pt 3. Free on main thread for non-incremental GCs r=jonco https://hg.mozilla.org/integration/autoland/rev/1a6c81eba852 pt 4. Delete some dead code r=jonco
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: