Closed Bug 1875455 Opened 1 year ago Closed 1 year ago

Parallel GC appears to be used in some places only

Categories

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

task

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: mayankleoboy1, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

See profile : https://share.firefox.dev/490AZvG

major use of taskcontrollers appear only in this range: 10s-15s

In the following other ranges (e.g.) there doesnt appear to be any major use : 20s-25s , 35s-40s

I dont understand much about GC. Feel free to INVALID :)

To repro the profile, go to : https://codepen.io/hippiefuturist/pen/NRWOxM
no of branches = 8 , Recursion level = 7

Attached file about:support
Flags: needinfo?(jcoppeard)

Thank you for this very interesting report!

Summary: paralle gc appears to be used in some places only → Parallel GC appears to be used in some places only

Currently we don't donate marking work to another thread if the size of the
mark stack is below a certain threshold. This is to prevent cases where we
repeatedly move work between stacks while making little progress.

However in some cases this results in marking work not being parallelised when
it could be. To improve this situation we can use a lower threshold when
distributing work at the start of a slice. This is OK because it only happens
relatively rarely.

This is something that I knew was possible but I didn't think it would happen
in real use. To be a problem it requires that we mark a data structure that
doesn't add many entries to the mark stack. A tree will add one mark stack
entry per level while it's being marked since we mark with depth first search.
So a problematic data structure could be tree that is not very deep but is very
wide. If most of the heap is taken up by such a data structure then we could
enter a state where we have a spare marking thread waiting for work but not
getting any.

Assignee: nobody → jcoppeard
Status: NEW → ASSIGNED
Flags: needinfo?(jcoppeard)

This is the profile i get from the try build : https://share.firefox.dev/42aMeiB

Severity: -- → N/A
Priority: -- → P3
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0e25f6f7415d Try harder to distribute parallel marking work at the start of slices r=sfink
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
See Also: → 1877620
Blocks: 1795640
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: