Budget throttling needs a notion of minimum budget amount

RESOLVED FIXED in Firefox 57

Status

()

enhancement
RESOLVED FIXED
2 years ago
a month ago

People

(Reporter: farre, Assigned: farre)

Tracking

unspecified
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
It's not enough to limit the lowest amount that we can schedule the timeout executor, since if we re-schedule we'll never decrease from that clamp (not until the budget has regenerated at least, which isn't what we want)
(Assignee)

Updated

2 years ago
Assignee: nobody → afarre
Blocks: 1377766
Comment on attachment 8898753 [details] [diff] [review]
0001-Bug-1391602-Clamp-execution-budget-to-a-minimum-valu.patch

Review of attachment 8898753 [details] [diff] [review]:
-----------------------------------------------------------------

So to make sure I understand...  The problem we had before this patch is we would limit the amount of delay, but the budget could end getting further and further behind.  Even if the page paused for a while it would have a very hard time getting out of the built-up negative budget deficit.

With this patch we avoid that by limiting how negative the budget can go.  This imposes the max delay like we used to have, but prevents the site from getting into a hole it can never recover from.

Is that accurate?

::: dom/base/TimeoutManager.cpp
@@ +97,5 @@
> +TimeDuration
> +GetMinBudget(bool aIsBackground)
> +{
> +  // The minimum budget is computed by looking up the maximum allowed
> +  // delay and computing how long time it would take to regenerate

nit: s/how long time it/how long it/
Attachment #8898753 - Flags: review?(bkelly) → review+
(Assignee)

Comment 3

2 years ago
Yes, but worse. If the executor got rescheduled it would be rescheduled to the same max value of the execution budget demanded a delay larger than that max value.

Comment 4

2 years ago
Pushed by afarre@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/82c496b0a128
Clamp execution budget to a minimum value. r=bkelly
https://hg.mozilla.org/mozilla-central/rev/82c496b0a128
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.