Closed Bug 1671490 Opened 4 years ago Closed 2 years ago

Increase the priority of the gpu process

Categories

(Core :: Graphics, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: jrmuizel, Assigned: bas.schouten)

References

(Blocks 4 open bugs)

Details

Attachments

(2 files)

Blocks: 1657183
Blocks: 1671498
Severity: -- → S3
Priority: -- → P3
Blocks: 1671859
Blocks: 1685848
Blocks: 1694017
No longer blocks: 1694017

I find that code in Chrome surprising because IIRC normal Windows applications aren't allowed to use anything above NORMAL_PRIORITY_CLASS without special permissions but maybe things have changed (or I may mis-remember).

Implementing this should be relatively simple, it's just a matter of modifying ParticularProcessPriorityManager::ComputePriority() to use PROCESS_PRIORITY_FOREGROUND_HIGH and then modify hal_impl::SetProcessPriority() to use ABOVE_NORMAL_PRIORITY_CLASS for that level.

There is one important thing to keep in mind though: if no special permissions are required and this works you have to double-check that the higher priority doesn't affect the rest of the program. We did implement this in Firefox OS back in the day and it provided butter-smooth scrolling and perfect 60Hz refresh but significantly starved the main process' main thread dragging down the whole system. It was different hardware (low-end dual-core Android SoCs) so what applied then might not apply anymore but it's worth keeping it in mind.

Blocks: 1732144
Assignee: nobody → bas
Status: NEW → ASSIGNED

See also the summary from https://phabricator.services.mozilla.com/D143056, which has some caveats to increase the priority of GPU process ("we have too many gfx threads").

See Also: → 1763405
Component: Graphics: WebRender → Graphics
Pushed by fqueze@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/18f23fa58771
Mark the GPU process as being in the foreground whenever the parent process is in the foreground to make their priorities (and priority boosts) match, r=bas.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Regressions: 1851991
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: