Closed Bug 979047 Opened 10 years ago Closed 10 years ago

Misc. ICC scheduling fixups

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(5 files, 1 obsolete file)

There are a few things that are a little off here.
Run FinishCycleCollectionSlice only once per slice, and only if we've previously run PrepareForCycleCollectionSlice.

https://tbpl.mozilla.org/?tree=Try&rev=c7e6a3a562d7
Attachment #8385420 - Flags: review?(bugs)
This way we take into account time spent finishing off a GC, or something.
Attachment #8385423 - Flags: review?(bugs)
With ICC, ccDelay can get close to NS_CC_SKIPPABLE_DELAY, but we want to always want to run at least one forgetSkippable before the actual CC.
Attachment #8385424 - Flags: review?(bugs)
Run FinishCycleCollectionSlice only once per slice, and only if we've previously run PrepareForCycleCollectionSlice.

Olli pointed out that we should probably initialize mBeginSliceTime, and I think it is a nice idea to ensure it is cleared when we're not running the CC, so I added back the clearing of it to Clear().
Attachment #8385420 - Attachment is obsolete: true
Attachment #8385420 - Flags: review?(bugs)
Attachment #8385507 - Flags: review?(bugs)
Comment on attachment 8385507 [details] [diff] [review]
part 1 - Only clear mBeginSliceTime in EndCycleCollectionCallback.

>+  if (!gCCStats.mBeginSliceTime.IsNull()) {
>+    gCCStats.FinishCycleCollectionSlice();
>+  }

FinishCycleCollectionSlice returns early if mBeginSliceTime is null, so you shouldn't need this.
Attachment #8385507 - Flags: review?(bugs) → review+
Attachment #8385421 - Flags: review?(bugs) → review+
Comment on attachment 8385422 [details] [diff] [review]
part 3 - Make sure we trigger a GC after a current ICC when we poke the GC.

Makes sense.
Attachment #8385422 - Flags: review?(bugs) → review+
Attachment #8385423 - Flags: review?(bugs) → review+
Comment on attachment 8385424 [details] [diff] [review]
part 5 - Make sure we have at least one early forgetSkippable timer fire.

I don't see how numEarlyTimerFires can be currently < 1.
Couldn't you just MOZ_ASSERT that numEarlyTimerFires >= 1

Either explain how numEarlyTimerFires can be < 1 (perhaps I missed something),
or just use assert.
Attachment #8385424 - Flags: review?(bugs) → review+
> I don't see how numEarlyTimerFires can be currently < 1.

I explained in IRC, but just for posterity, this isn't a problem right now, but I've been messing around with kMaxICCDuration, and when you make it larger, like 4000, then you can hit problems.

The problem is even worse right now on trunk when you increase that value, because numEarlyTimerFires is a uint which underflows, so you just keep running the early timer fires forever, and never actually run the CC.
(In reply to Olli Pettay [:smaug] from comment #7)
> FinishCycleCollectionSlice returns early if mBeginSliceTime is null, so you
> shouldn't need this.

Good catch!  I fixed that.  As you can see, this patch had a lot of iterations.

remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/8b0775be6f49
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/f05c51c43275
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/aed1ab91fd8a
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/cd36571c4d92
remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/331738fa38a5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: