Closed
Bug 1394710
Opened 7 years ago
Closed 7 years ago
Changing priority on Window processes
Categories
(Core :: IPC, enhancement, P3)
Core
IPC
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: baku, Assigned: alexical)
References
(Blocks 2 open bugs)
Details
Attachments
(1 file, 1 obsolete file)
+++ This bug was initially created as a clone of Bug #1372543 +++
Bug 1366356 implements the support for changing the process priority but it doesn't include any platform-specific implementation. Here, the windows one.
![]() |
||
Updated•7 years ago
|
Priority: -- → P3
Assignee | ||
Comment 1•7 years ago
|
||
I'd like to take a look at this and see if it has any impact on tab switch timings (among other things).
Assignee: nobody → dothayer
Status: NEW → ASSIGNED
Comment 2•7 years ago
|
||
Fairly straightforward. Using an idle priority class for
background, which mirrors what I am observing of Chromium in
Process Explorer.
Assignee | ||
Comment 3•7 years ago
|
||
Hey Jim, just realized (this was my first and so far only use of phabricator) that this doesn't set r? flags on you. Have you seen this review request yet? Would you prefer it if I sent it through mozreview?
(Or let me know if you'd just prefer someone else to review this and I can find someone.)
Flags: needinfo?(jmathies)
Comment hidden (mozreview-request) |
Out of curiosity, are there any plans for followup work to use PROCESS_MODE_BACKGROUND_BEGIN/END?
Assignee | ||
Comment 6•7 years ago
|
||
I'm not aware of any - but in order to do that we'd need to send a message to the process in question to update its priority class itself, since we can't set those for a process other than our own. Also, the MSDN documentation is rather sparse on the details of PROCESS_MODE_BACKGROUND_BEGIN. Do you happen to have a better understanding of it - the chromium source[1] has this comment in the code talking about it, noting that it reduces the priority of IO:
// Vista and above introduce a real background mode, which not only
// sets the priority class on the threads but also on the IO generated
// by it. Unfortunately it can only be set for the calling process.
And this SO question[2] suggests that it limits the process's working set to 32MB:
[1]: https://cs.chromium.org/chromium/src/base/process/process_win.cc?type=cs&q=PROCESS_MODE_BACKGROUND_BEGIN&sq=package:chromium&g=0&l=206
[2]: https://stackoverflow.com/a/30509372
I don't have any experience with it myself, I just noticed the caution on MSDN that lowering CPU priority alone may be ineffective if I/O and network traffic are still happening at standard priority.
Comment 8•7 years ago
|
||
I am not opposed to reviewing the patch as-is, but I would like to see a follow-up bug and a commitment to investigate the implications of PROCESS_MODE_BACKGROUND_BEGIN/END.
I don't want it to turn in to one of these, "Yeah, that'd be nice" bugs that languish in obscurity for all eternity.
Doug, do you think you can get a bug filed and prioritized for such an investigation?
Flags: needinfo?(dothayer)
Assignee | ||
Comment 9•7 years ago
|
||
(In reply to Aaron Klotz [:aklotz] from comment #8)
> I am not opposed to reviewing the patch as-is, but I would like to see a
> follow-up bug and a commitment to investigate the implications of
> PROCESS_MODE_BACKGROUND_BEGIN/END.
>
> I don't want it to turn in to one of these, "Yeah, that'd be nice" bugs that
> languish in obscurity for all eternity.
>
> Doug, do you think you can get a bug filed and prioritized for such an
> investigation?
Created, and flagged for fxperf triage.
Flags: needinfo?(dothayer)
Comment 11•7 years ago
|
||
mozreview-review |
Comment on attachment 8992385 [details]
Bug 1394710 - Set process priority class on Windows
https://reviewboard.mozilla.org/r/257246/#review264446
r=me with issues resolved.
::: hal/windows/WindowsProcessPriority.cpp:27
(Diff revision 1)
> +SetProcessPriority(int aPid, ProcessPriority aPriority)
> +{
> + HAL_LOG("WindowsProcessPriority - SetProcessPriority(%d, %s)\n",
> + aPid, ProcessPriorityToString(aPriority));
> +
> + HANDLE hProcess = ::OpenProcess(PROCESS_SET_INFORMATION, false, aPid);
How about we use nsAutoHandle here, so we don't need to explicitly CloseHandle?
::: hal/windows/WindowsProcessPriority.cpp:27
(Diff revision 1)
> +SetProcessPriority(int aPid, ProcessPriority aPriority)
> +{
> + HAL_LOG("WindowsProcessPriority - SetProcessPriority(%d, %s)\n",
> + aPid, ProcessPriorityToString(aPriority));
> +
> + HANDLE hProcess = ::OpenProcess(PROCESS_SET_INFORMATION, false, aPid);
s/false/FALSE/
::: hal/windows/WindowsProcessPriority.cpp:28
(Diff revision 1)
> +{
> + HAL_LOG("WindowsProcessPriority - SetProcessPriority(%d, %s)\n",
> + aPid, ProcessPriorityToString(aPriority));
> +
> + HANDLE hProcess = ::OpenProcess(PROCESS_SET_INFORMATION, false, aPid);
> + if (hProcess) {
Please MOZ_ASSERT this as well.
Attachment #8992385 -
Flags: review?(aklotz) → review+
Comment 12•7 years ago
|
||
Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/73ed61535854
Set process priority class on Windows r=aklotz
Assignee | ||
Comment 13•7 years ago
|
||
Arg. Embarrassing. Brain farted and didn't push to review before autolanding.
Comment hidden (mozreview-request) |
Comment 15•7 years ago
|
||
Backed out for braking Gecko Decision Task.
Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=success&filter-searchStr=Gecko%20Decision%20Task%20opt%20Gecko%20Decision%20Task%20(D)&fromchange=73ed615358542b987c2c2a8d0730adf0b915a0f6&tochange=be3f6d08fb1715837b86d49c82efe6f776b3247a&selectedJob=188814248
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=188814248&repo=autoland&lineNumber=2267
Backout link: https://hg.mozilla.org/integration/autoland/rev/be3f6d08fb1715837b86d49c82efe6f776b3247a
Flags: needinfo?(dothayer)
Comment 16•7 years ago
|
||
Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e0b454aac6e
Set process priority class on Windows r=aklotz
Assignee | ||
Updated•7 years ago
|
Flags: needinfo?(dothayer)
Comment 17•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Comment 18•7 years ago
|
||
Hey dthayer, is there a way we can make sure this stays on Nightly until we're sure it's able to ride the trains to release? Or is that already covered somehow?
Flags: needinfo?(dothayer)
Assignee | ||
Comment 19•7 years ago
|
||
That's already covered by the pref "dom.ipc.processPriorityManager.enabled", which is still disabled in Nightly. My plan is to write a patch turning it on in Nightly, and ask baku if he thinks the patch from bug 1366356 is ready for Nightly. This is being tracked in bug 1476981.
Flags: needinfo?(dothayer)
Comment 20•7 years ago
|
||
Ah, excellent, thanks!
Updated•7 years ago
|
Attachment #8984601 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•