Closed Bug 1627954 Opened 5 years ago Closed 5 years ago

Record time taken by parallel GC tasks in the same place even if they were run on the main thread

Categories

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

task

Tracking

()

RESOLVED FIXED
mozilla77
Tracking Status
firefox77 --- fixed

People

(Reporter: jonco, Assigned: jonco)

Details

Attachments

(3 files)

Since bug 1592537 we can run parallel GC tasks on the main thread if no thread has stared the task by the time we start to wait for it, to avoid blocking GC completely if all threads are busy.

Currently this records the time taken by the task as a main thread GC phase, and I think this has resulted in some large movements in GC telemetry from what should be unrelated changes (telemetry for main thread phases and parallel task phases is reported separately)

The time taken by these tasks should always be attributed to parallel tasks, even if they end up being run on the main thread.

Here's GC_SLOW_PHASE telemetry around the time bug 1618638 and then bug 1622757 landed. Phase 7 is unmarking, a parallel task, which suddenly showed up in the main thread telemetry, then disappeared again.

Record all time taken by parallel tasks as parallel phases, even if they ended up being executed on the main thread.

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8d3f2162b557 Parallel task telemetry is sometimes misattributed r=sfink
Backout by aiakab@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fcea1326c9fb Backed out changeset 8d3f2162b557 for causing multiple crashes on [@ js::gcstats::Statistics::lookupChildPhase(js::gcstats::PhaseKind) const]

This was causing problems for the previous patch because we don't collect timing information in phases for background tasks, and it's hard to tell when something is a background task or not when we can run them on the main thread.

This means that gray unmarking that occurs during the course of normal marking (the call to UnmarkGrayGCThingUnchecked in ShouldMarkCrossCompartment) no longer gets its own stats phase but I don't see that as much of an issue.

I tidied up a bit and used Maybe<> to replace the extra AutoPhase consturctor that took an 'enable' argument.

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/00843b46fca8 Remove separate stats phase for gray unmarking that occurs during the course of normal marking r=sfink https://hg.mozilla.org/integration/autoland/rev/5f8c36c2bbbc Parallel task telemetry is sometimes misattributed r=sfink
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: