Inter-process GC scheduling should account for JS engine initiated GCs
Categories
(Core :: DOM: Content Processes, enhancement, P2)
Tracking
()
People
(Reporter: pbone, Assigned: pbone)
References
(Regressed 1 open bug)
Details
(Keywords: perf-alert, Whiteboard: fission-soft-blocker)
Attachments
(3 files, 7 obsolete files)
Bug 1629064 will introduce inter-process GC scheduling. We will avoid overwhelming the system with many GCs in different processes. However it ignores GCs started immediately based on memory threshold triggers. it should take these into account when scheduling GCs. In other words, a process should always be able to begin a GC if it hits a threshold (already implemented), but another process requesting a GC may have to wait for it (not implemented).
Assignee | ||
Comment 1•3 years ago
|
||
The JS engine can start GCs based on allocation thresholds (for example).
We don't ask the parent if we should run one of these, but by letting the
parent know that's what's happening it can schedule other GC requests
appropriately.
Comment 2•3 years ago
|
||
When digging into the regressions I never managed to fully track down, I noticed that I had changed how GCReasons were recorded, in more ways than intended. I have some patches in bug 1711128 to revert the change, but it got a little tangled up in the code you just landed. So that bug now includes a fix for this bug, if we want to do things the way I'm proposing over there.
Comment 3•3 years ago
|
||
Wait, no, I am wrong. Bug 1711128 does the opposite of this. Depending on which lands first, I think you'll either want your existing patch or a slight rebase on top of bug 1711128. Sorry for the confusion; hopefully I can get better clued in during our meeting a later on today.
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Or M7a, since this is kind of a regression from a M7a bug.
Comment 6•3 years ago
|
||
...and again, I misread what you very clearly stated in this bug. You're not blocking internally generated GCs; you're allowing them to block other processes' GCs. Doh! That makes sense.
Assignee | ||
Comment 7•3 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #5)
Or M7a, since this is kind of a regression from a M7a bug.
More like an edge case that the other bug doesn't cover. But the edge case is much less important, I don't expect it to hurt users' experience the way Bug 1629064 did.
Assignee | ||
Comment 8•3 years ago
|
||
Actually my patch here could introduce further edge cases. I can do Bug 1703443 first and prevent all the edge cases there.
Updated•3 years ago
|
Assignee | ||
Comment 9•3 years ago
|
||
Assignee | ||
Comment 10•3 years ago
|
||
Depends on D120780
Assignee | ||
Comment 11•3 years ago
|
||
Depends on D120781
Assignee | ||
Comment 12•3 years ago
|
||
Depends on D120782
Assignee | ||
Comment 13•3 years ago
|
||
Depends on D120783
Assignee | ||
Comment 14•3 years ago
|
||
time r=smaug
Depends on D120784
Comment 15•3 years ago
|
||
Comment on attachment 9232931 [details]
Bug 1710552 - pt 1. Remove a redundant statement r=smaug
Revision D120780 was moved to bug 1722143. Setting attachment 9232931 [details] to obsolete.
Comment 16•3 years ago
|
||
Comment on attachment 9232932 [details]
Bug 1710552 - pt 2. Make GetNextGCRunnerAction() const r=smaug
Revision D120781 was moved to bug 1722143. Setting attachment 9232932 [details] to obsolete.
Comment 17•3 years ago
|
||
Comment on attachment 9232933 [details]
Bug 1710552 - pt 3. Move some definitions into .cpp file r=smaug
Revision D120782 was moved to bug 1722143. Setting attachment 9232933 [details] to obsolete.
Comment 18•3 years ago
|
||
Comment on attachment 9232934 [details]
Bug 1710552 - pt 4. GetNextGCRunnerAction() doesn't need a deadline r=smaug
Revision D120783 was moved to bug 1722143. Setting attachment 9232934 [details] to obsolete.
Comment 19•3 years ago
|
||
Comment on attachment 9232935 [details]
Bug 1710552 - pt 5. Use GCRunnerFired to handle full and user inactive GCs r=smaug
Revision D120784 was moved to bug 1722143. Setting attachment 9232935 [details] to obsolete.
Comment 20•3 years ago
|
||
Comment on attachment 9232936 [details]
WIP: Bug 1710552 - pt 6. Run the first slice of Full and User-idle GCs in idle
Revision D120785 was moved to bug 1722143. Setting attachment 9232936 [details] to obsolete.
Assignee | ||
Comment 21•3 years ago
|
||
This patch also:
-
adds an assertion to KillGCRunner() to ensure it's never killed if
needed, now that there are more calls to KillGCRunner(), some calls have
been moved eg in nsJSEnvironment so as not to kill the runner a little
later and keep the assertions happy. -
IdleSchedulerChild will decline a request for a GC if there's already a
request in flight. -
CCGCScheduler will check if a GC is already in progress when handling the
parents' response to a GC request.
Assignee | ||
Comment 22•3 years ago
|
||
This lets the idle scheduler know that we've initiated a GC that we didn't
ask its permission for. Eg the JS engine hit a threshold. It now uses this
info when scheduling GCs for other processes.
Depends on D120830
Assignee | ||
Comment 23•3 years ago
|
||
Depends on D120831
Updated•3 years ago
|
Comment 24•3 years ago
|
||
This bug is a soft blocker for Fission MVP. We'd like to fix it before our Release channel rollout, but we won't delay the rollout waiting for it.
Assignee | ||
Comment 25•3 years ago
|
||
This is ready to land but I will wait until after the soft-freeze.
Comment 26•3 years ago
|
||
Pushed by pbone@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eee94cab9825 pt 1. Prepare for GCs being denied r=smaug https://hg.mozilla.org/integration/autoland/rev/09a9a01bbfff pt 2. Inform the idle scheduler when we initiate a GC r=smaug https://hg.mozilla.org/integration/autoland/rev/0d808485592f pt 3. Fix some whitespace r=smaug
Comment 27•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eee94cab9825
https://hg.mozilla.org/mozilla-central/rev/09a9a01bbfff
https://hg.mozilla.org/mozilla-central/rev/0d808485592f
Updated•3 years ago
|
Comment 28•3 years ago
|
||
== Change summary for alert #30931 (as of Sun, 15 Aug 2021 19:49:29 GMT) ==
Improvements:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
2% | ares6 | macosx1015-64-shippable-qr | webrender | 53.40 -> 52.24 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=30931
Updated•3 years ago
|
Description
•