Closed
Bug 820378
Opened 13 years ago
Closed 13 years ago
Try to postpone triggering CC if we're in middle of GC handling
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: smaug, Assigned: smaug)
References
Details
(Keywords: regression, Whiteboard: [Snappy])
Attachments
(1 file, 9 obsolete files)
|
868 bytes,
patch
|
bajaj
:
approval-mozilla-aurora+
bajaj
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Right now it is too easy to run CC very soon after GC.
Also, if there is already incrementalgctimer, why should we start gctimer?
| Assignee | ||
Comment 1•13 years ago
|
||
Shouldn't regress bug 730853, but may make some of the changes of that and of bug 758034
somewhat redundant.
| Assignee | ||
Comment 2•13 years ago
|
||
But in general we should try to avoid the cases when GC and CC handling overlap.
If CCtimer is running while we are doing incremental GC, CC's black bit propagation is less than
optimal and eventually we just may have to force GC in order to run CC.
| Assignee | ||
Comment 3•13 years ago
|
||
Attachment #690869 -
Attachment is obsolete: true
| Assignee | ||
Comment 4•13 years ago
|
||
I'm little worried that the patch is too strict.
| Assignee | ||
Comment 5•13 years ago
|
||
Attachment #690872 -
Attachment is obsolete: true
| Assignee | ||
Comment 6•13 years ago
|
||
| Assignee | ||
Comment 7•13 years ago
|
||
So the patch should make it less likely to run CC very soon after GC. That gives more time for
forgetSkippable to optimize things out. (GC soon after CC shouldn't be a problem)
| Assignee | ||
Comment 8•13 years ago
|
||
Interestingly the patch triggers a GC assertion
https://tbpl.mozilla.org/php/getParsedLog.php?id=17835872&tree=Try&full=1#error0
Cool, this looks like bug 811587. I'll take a look tomorrow.
Flags: needinfo?(wmccloskey)
| Assignee | ||
Comment 10•13 years ago
|
||
Comment on attachment 690999 [details] [diff] [review]
WIP3
Assuming the GC assertion is fixed, what do you think of this?
Attachment #690999 -
Flags: review?(continuation)
Comment 11•13 years ago
|
||
Comment on attachment 690999 [details] [diff] [review]
WIP3
Review of attachment 690999 [details] [diff] [review]:
-----------------------------------------------------------------
Bill may want to look at this, as it is going to mean we delay triggering the GC from a timer.
::: dom/base/nsJSEnvironment.cpp
@@ +3087,5 @@
>
> // If we collected a substantial amount of cycles, poke the GC since more objects
> // might be unreachable now.
> if (sCCollectedWaitingForGC > 250) {
> + // Try to start running GC reasonable soon after CC, so that
reasonable -> reasonably
@@ +3247,5 @@
> PRTime now = PR_Now();
> if (sCCLockedOutTime == 0) {
> + // Reset sCCTimerFireCount so that we end up running forgetSkippable
> + // often enough before CC. Because of reduced ccDelay
> + // forgetSkippable will be called just few times.
just -> just a
@@ +3551,5 @@
> nsJSContext::KillInterSliceGCTimer();
>
> sCCollectedWaitingForGC = 0;
> sCleanupsSinceLastGC = 0;
> + sNeedsFullCC = !aDesc.isCompartment;
Why do you change this to only trigger a CC after a full GC?
Attachment #690999 -
Flags: review?(continuation)
Attachment #690999 -
Flags: review+
Attachment #690999 -
Flags: feedback?(wmccloskey)
| Assignee | ||
Comment 12•13 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #11)
> @@ +3551,5 @@
> > nsJSContext::KillInterSliceGCTimer();
> >
> > sCCollectedWaitingForGC = 0;
> > sCleanupsSinceLastGC = 0;
> > + sNeedsFullCC = !aDesc.isCompartment;
>
> Why do you change this to only trigger a CC after a full GC?
Well, we do still trigger CC timer if there is enough stuff to collect
But in certain JS heavy pages we get often compartment GCs. In such cases we often don't need to run
CC timer so often. Just run CC after such GC which has ended up causing lots of suspected objects.
| Assignee | ||
Comment 13•13 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #11)
> Bill may want to look at this, as it is going to mean we delay triggering
> the GC from a timer.
Sure, but JS_MaybeGC does still get called, so we may end up running GC while there is CC timer running if there
really is something to collect.
| Assignee | ||
Comment 14•13 years ago
|
||
I'm seeing actually quite bad behavior too often. We should consider fixing this even for FF19.
I don't know what has regressed this.
tracking-firefox19:
--- → ?
tracking-firefox20:
--- → ?
| Assignee | ||
Comment 15•13 years ago
|
||
This should help with max GC times too, since iGC doesn't need to be interrupted by CC so often.
I'm currently using a build with the patch, and initial results look good.
Olli, I posted a patch to fix the assertion in bug 811587.
Flags: needinfo?(wmccloskey)
| Assignee | ||
Comment 17•13 years ago
|
||
I wonder if the patch is a bit too strict. Perhaps GC should get better chances to run.
| Assignee | ||
Comment 18•13 years ago
|
||
I'll test this locally
https://tbpl.mozilla.org/?tree=Try&rev=2dc92d348804
Attachment #690999 -
Attachment is obsolete: true
Attachment #690999 -
Flags: feedback?(wmccloskey)
Attachment #692678 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 19•13 years ago
|
||
Yeah, that patch seems to work better. We do still call GC often enough, but not so that CC
runs too soon after GC.
| Assignee | ||
Comment 20•13 years ago
|
||
Bah, need still one tweak
| Assignee | ||
Comment 21•13 years ago
|
||
or maybe not. I'd be ok to try the attached patch.
| Assignee | ||
Comment 22•13 years ago
|
||
Or let's try this after all.
If we try to start gc while we have cc timer running, make sure to start
gc timer after cc timer.
Attachment #692678 -
Attachment is obsolete: true
Attachment #692678 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 23•13 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=1a9737afeb79 for tryserver builds.
These patches are a bit slow to test. Takes a day or so to see the behavior in
various situations.
| Assignee | ||
Updated•13 years ago
|
Attachment #692801 -
Flags: review?(wmccloskey)
| Assignee | ||
Comment 24•13 years ago
|
||
So far the patch has been working the way I want.
Posted the GC assertion fix + the patch in this bug to try
https://tbpl.mozilla.org/?tree=Try&rev=31246cd0c014
| Assignee | ||
Comment 25•13 years ago
|
||
Argh, that setup leaks on windows.
Comment 26•13 years ago
|
||
Tracking for now, would be great to find out what regressed this so we can look at our options here for Aurora (19).
Comment on attachment 692801 [details] [diff] [review]
wip3
Review of attachment 692801 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me.
::: dom/base/nsJSEnvironment.cpp
@@ +3159,5 @@
>
> // If we collected a substantial amount of cycles, poke the GC since more objects
> // might be unreachable now.
> if (sCCollectedWaitingForGC > 250) {
> + // Try to start running GC reasonable soon after CC, so that
reasonably soon. Also, there's no need for the comma.
Attachment #692801 -
Flags: review?(wmccloskey) → review+
| Assignee | ||
Comment 28•13 years ago
|
||
Trying to figure out the Win debug leak
https://tbpl.mozilla.org/?tree=Try&rev=0c6a8c156582
| Assignee | ||
Comment 29•13 years ago
|
||
like v5, but makes sure we exit forgetSkippable timer sooner if
we're expecting to run GC soon.
Attachment #693896 -
Attachment is obsolete: true
| Assignee | ||
Comment 30•13 years ago
|
||
Attachment #694850 -
Attachment is obsolete: true
Updated•13 years ago
|
Whiteboard: [Snappy]
| Assignee | ||
Comment 31•13 years ago
|
||
Since nothing has quite worked yet, perhaps this kind of
super simple approach could be enough for most common cases.
https://tbpl.mozilla.org/?tree=Try&rev=a920a6fdcfb1
| Assignee | ||
Comment 32•13 years ago
|
||
Comment on attachment 698847 [details] [diff] [review]
simple
Assuming this passes on try, I could push tomorrow "morning" EET.
This is a tiny part of the already reviewed patch.
Attachment #698847 -
Flags: review?(continuation)
Comment 33•13 years ago
|
||
Comment on attachment 698847 [details] [diff] [review]
simple
Review of attachment 698847 [details] [diff] [review]:
-----------------------------------------------------------------
That makes a lot of sense.
I did a little bit of local testing, and this patch did eliminate all sync forget skippables.
::: dom/base/nsJSEnvironment.cpp
@@ +3307,5 @@
> ccDelay = NS_CC_DELAY / 3;
>
> PRTime now = PR_Now();
> if (sCCLockedOutTime == 0) {
> + // Reset sCCTimerFireCount so that we end up running forgetSkippable
"we end up running" can probably be "we run"
@@ +3309,5 @@
> PRTime now = PR_Now();
> if (sCCLockedOutTime == 0) {
> + // Reset sCCTimerFireCount so that we end up running forgetSkippable
> + // often enough before CC. Because of reduced ccDelay
> + // forgetSkippable will be called just few times.
"just few" -> "just a few"
Attachment #698847 -
Flags: review?(continuation) → review+
| Assignee | ||
Comment 34•13 years ago
|
||
Let's try other improvements in some other bug
Attachment #692801 -
Attachment is obsolete: true
Attachment #694851 -
Attachment is obsolete: true
Attachment #698847 -
Attachment is obsolete: true
| Assignee | ||
Comment 35•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 36•13 years ago
|
||
Comment on attachment 699088 [details] [diff] [review]
patch
I think this might be good for branches, at least for Aurora.
[Approval Request Comment]
Bug caused by (feature/regressing bug #): kind of bug 730853, but iGC wasn't enabled at that time, I think
User impact if declined: higher pause times when CC runs
Testing completed (on m-c, etc.): landed to m-c
Risk to taking this patch (and alternatives if risky): should be reasonable safe
String or UUID changes made by this patch: NA
Attachment #699088 -
Flags: approval-mozilla-beta?
Attachment #699088 -
Flags: approval-mozilla-aurora?
| Assignee | ||
Comment 37•13 years ago
|
||
Seems to be effective change. Reduces risk for higher than needed pauses when running CC.
And should be safe for branches, even for beta.
| Assignee | ||
Comment 38•13 years ago
|
||
Based on telemetry this was very effective.
Comment 39•13 years ago
|
||
Comment on attachment 699088 [details] [diff] [review]
patch
Considering comment#36,37,38 & where we are in the cycle approving on aurora/beta.We will be going to build with beta# 2 on Tuesday , which will include this patch giving us 4-5 weeks of testing before release.
Attachment #699088 -
Flags: approval-mozilla-beta?
Attachment #699088 -
Flags: approval-mozilla-beta+
Attachment #699088 -
Flags: approval-mozilla-aurora?
Attachment #699088 -
Flags: approval-mozilla-aurora+
| Assignee | ||
Comment 40•13 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/23b7a6b505e0
https://hg.mozilla.org/releases/mozilla-beta/rev/1b69a74d8c9c
status-firefox19:
--- → fixed
status-firefox20:
--- → fixed
Updated•13 years ago
|
status-firefox21:
--- → fixed
Target Milestone: --- → mozilla21
Updated•11 years ago
|
Keywords: regressionwindow-wanted
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•