Closed Bug 1706383 Opened 3 years ago Closed 3 years ago

Investigate whether dom.ipc.processPriorityManager.backgroundGracePeriodMS may help with content terminations

Categories

(GeckoView :: General, enhancement, P1)

Unspecified
All
enhancement

Tracking

(Not tracked)

RESOLVED FIXED
90 Branch

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

(Keywords: leave-open, Whiteboard: [geckoview:m90])

Attachments

(1 file)

This pref, as well as dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS, cause the priority manager to wait until the grace period elapses before dropping priority.

Priority: -- → P1
Whiteboard: [geckoview:m90?] → [geckoview:m90]
Assignee: nobody → aklotz

Because of the way the process priority manager works, a tab switch may alter
priorities like so:

  1. User switches from tab1 to tab2;
  2. We drop tab1's content process priority;
  3. We raise tab2's content process priority;

But if tab1 and tab2 live in the same content process, then not only is
the priority adjustment redundant, it gives Android an opportunity to kill
the content process between steps (2) and (3)!

By setting a brief grace period, the priority manager will wait a bit until
dropping priority of tab1:

  1. User switches from tab1 to tab2;
  2. We start the grace period for dropping tab1's priority;
  3. We go to raise tab2's priority, but since the content process is already
    foreground, this becomes a no-op;
  4. Grace period expires for tab1, but we see that tab2 is still using our
    content process, so the "drop" becomes a no-op.

Nightly only for now, we'll see how this affects tab kills.

Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9927b4e6d1c1
Set process priority manager grace periods for GeckoView Nightly; r=geckoview-reviewers,agi

I'm going to resolve this and follow up on the analysis elsewhere.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: