Investigate not waiting for off thread ion compilation during GC
Categories
(Core :: JavaScript: GC, defect, P3)
Tracking
()
People
(Reporter: jonco, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: triage-deferred)
Comment 1•9 years ago
|
||
Updated•8 years ago
|
Comment 2•6 years ago
|
||
Jan, do you know if this still is valid / makes sense?
Comment 3•6 years ago
•
|
||
(In reply to Ted Campbell [:tcampbell] from comment #2)
Jan, do you know if this still is valid / makes sense?
The relevant code is here: https://searchfox.org/mozilla-central/rev/94c6b5f06d2464f6780a52f32e917d25ddc30d6b/js/src/vm/HelperThreads.cpp#321-335
The idea would be to just cancel() these builders without waiting for the thread to finish. A safer approach is to make it a two-step process, for example here in DiscardJITCodeForGC we could do something like this:
- cancel() off-thread builders.
- Discard all JIT code.
- wait() for threads to finish.
So instead of waiting immediately we go do some other stuff first and hope that gives the threads enough time to finish. There could be a RAII class for steps 1 and 3.
The risk is the background thread accessing a script's BaselineScript, TypeScript, ICScript etc that we're discarding (but it really shouldn't).
Jon, do you know what the performance impact on GC is these days?
Reporter | ||
Comment 4•6 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #3)
Jon, do you know what the performance impact on GC is these days?
We don't have telemetry for cancelling Ion compilation specifically, so it's difficult to say. During marking this happens on the main thread during the PREPARE phase. This has a very low incidence in over budget slices, so I think it's likely overshadowed by the longer operations we do on helper threads concurrently. So I don't think it's a problem for us right now.
I'll file a bug to add telemetry, although we'll lose this again if we do your suggestion of combining cancelling Ion with discarding JIT code.
Updated•3 years ago
|
Description
•