Closed Bug 1476365 Opened 7 years ago Closed 1 year ago

Investigate consequences of using PROCESS_MODE_BACKGROUND_BEGIN/END when setting Windows process priorities

Categories

(Core :: IPC, enhancement, P3)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: alexical, Unassigned)

References

Details

See the MSDN documentation here (scroll to Remarks): https://docs.microsoft.com/en-us/windows/desktop/api/processthreadsapi/nf-processthreadsapi-setpriorityclass There's also an SO question that suggests that this additionally limits the working set of the backgrounded process to 32MB: https://stackoverflow.com/a/30509372 Chromium does set this value, though I don't know how commonly, since it just opts to set it when the code that is being called is being run in the process to be throttled - in practice I don't know how often that code is called from the parent process or not. In practice I believe I should see "I/O Priority" in Process Explorer go down if they are setting this value, and I don't see that, so I think they are just using IDLE_PRIORITY_CLASS.
Whiteboard: [fxperf] → [fxperf:p3]
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
This is actually not a dupe; I asked Doug to file this in https://bugzilla.mozilla.org/show_bug.cgi?id=1394710#c8 because I think that for bug 1394710 to ride the trains, we need to know more about how this flag affects the process working set.
Status: RESOLVED → REOPENED
Flags: needinfo?(jmathies)
Resolution: DUPLICATE → ---
Summary: Investigate using PROCESS_MODE_BACKGROUND_BEGIN/END when setting Windows process priorities → Investigate consequences of using PROCESS_MODE_BACKGROUND_BEGIN/END when setting Windows process priorities
Flags: needinfo?(jmathies)
Priority: -- → P3
Severity: normal → S3

bug 1366356 is fixed and I can't find non-test, non-installer/setup uses of PROCESS_MODE_BACKGROUND_BEGIN in chromium src - https://source.chromium.org/search?q=PROCESS_MODE_BACKGROUND_BEGIN&ss=chromium - and I did find https://bugs.chromium.org/p/chromium/issues/detail?id=1396155 .

This isn't really a frontend perf bug despite the fxperf tag - but perhaps it can just be closed out at this point? Doug, is there still something useful we can/should be doing here?

Flags: needinfo?(dothayer)

For the purpose of clarity Chrome recently removed usage of PROCESS_MODE_BACKGROUND_BEGIN:

https://chromium-review.googlesource.com/c/chromium/src/+/4894757?tab=comments

An extensive write-up on the issue can be found here:

https://randomascii.wordpress.com/2023/10/01/32-mib-working-sets-on-a-64-gib-machine/

The summary quote from the article is:

“if your process uses more than 32 MiB of memory then [PROCESS_MODE_BACKGROUND_BEGIN] may make your program run 250 times slower and it won’t really save memory so maybe use THREAD_MODE_BACKGROUND_BEGIN instead

Looks like we probably shouldn't do this, because running 250x slower sounds like a bad idea.

Status: REOPENED → RESOLVED
Closed: 6 years ago1 year ago
Resolution: --- → WONTFIX
Flags: needinfo?(dothayer)
Whiteboard: [fxperf:p3]
You need to log in before you can comment on or make changes to this bug.