mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 959966: prevent the preallocated process from being killed by the lowmem killer by rasing its priority. r=khuey,gsvelto
This commit is contained in:
parent
e130a37108
commit
b22bcfe208
@ -650,6 +650,9 @@ pref("hal.processPriorityManager.gonk.MASTER.OomScoreAdjust", 0);
|
||||
pref("hal.processPriorityManager.gonk.MASTER.KillUnderKB", 4096);
|
||||
pref("hal.processPriorityManager.gonk.MASTER.Nice", 0);
|
||||
|
||||
pref("hal.processPriorityManager.gonk.PREALLOC.OomScoreAdjust", 67);
|
||||
pref("hal.processPriorityManager.gonk.PREALLOC.Nice", 18);
|
||||
|
||||
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.OomScoreAdjust", 67);
|
||||
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.KillUnderKB", 5120);
|
||||
pref("hal.processPriorityManager.gonk.FOREGROUND_HIGH.Nice", 0);
|
||||
|
@ -61,7 +61,7 @@ function runTest()
|
||||
// Ensure that the preallocated process initially gets BACKGROUND priority.
|
||||
// That's it.
|
||||
expectProcessCreated().then(function(childID) {
|
||||
return expectPriorityChange(childID, 'BACKGROUND');
|
||||
return expectPriorityChange(childID, 'PREALLOC');
|
||||
}).then(function() {
|
||||
cleanUp();
|
||||
SimpleTest.finish();
|
||||
|
@ -448,7 +448,7 @@ ContentParent::PreallocateAppProcess()
|
||||
new ContentParent(/* app = */ nullptr,
|
||||
/* isForBrowserElement = */ false,
|
||||
/* isForPreallocated = */ true,
|
||||
PROCESS_PRIORITY_BACKGROUND);
|
||||
PROCESS_PRIORITY_PREALLOC);
|
||||
process->Init();
|
||||
return process.forget();
|
||||
}
|
||||
@ -1464,7 +1464,7 @@ ContentParent::ContentParent(ContentParent* aTemplate,
|
||||
// memory priority, which it has inherited from this process.
|
||||
ProcessPriority priority;
|
||||
if (IsPreallocated()) {
|
||||
priority = PROCESS_PRIORITY_BACKGROUND;
|
||||
priority = PROCESS_PRIORITY_PREALLOC;
|
||||
} else {
|
||||
priority = PROCESS_PRIORITY_FOREGROUND;
|
||||
}
|
||||
|
@ -945,6 +945,10 @@ ParticularProcessPriorityManager::ComputePriority()
|
||||
ProcessCPUPriority
|
||||
ParticularProcessPriorityManager::ComputeCPUPriority()
|
||||
{
|
||||
if (mPriority == PROCESS_PRIORITY_PREALLOC) {
|
||||
return PROCESS_CPU_PRIORITY_LOW;
|
||||
}
|
||||
|
||||
if (mPriority >= PROCESS_PRIORITY_FOREGROUND_HIGH) {
|
||||
return PROCESS_CPU_PRIORITY_NORMAL;
|
||||
}
|
||||
|
@ -884,6 +884,8 @@ ProcessPriorityToString(ProcessPriority aPriority)
|
||||
switch (aPriority) {
|
||||
case PROCESS_PRIORITY_MASTER:
|
||||
return "MASTER";
|
||||
case PROCESS_PRIORITY_PREALLOC:
|
||||
return "PREALLOC";
|
||||
case PROCESS_PRIORITY_FOREGROUND_HIGH:
|
||||
return "FOREGROUND_HIGH";
|
||||
case PROCESS_PRIORITY_FOREGROUND:
|
||||
@ -934,6 +936,13 @@ ProcessPriorityToString(ProcessPriority aPriority,
|
||||
if (aCPUPriority == PROCESS_CPU_PRIORITY_LOW) {
|
||||
return "MASTER:CPU_LOW";
|
||||
}
|
||||
case PROCESS_PRIORITY_PREALLOC:
|
||||
if (aCPUPriority == PROCESS_CPU_PRIORITY_NORMAL) {
|
||||
return "PREALLOC:CPU_NORMAL";
|
||||
}
|
||||
if (aCPUPriority == PROCESS_CPU_PRIORITY_LOW) {
|
||||
return "PREALLOC:CPU_LOW";
|
||||
}
|
||||
case PROCESS_PRIORITY_FOREGROUND_HIGH:
|
||||
if (aCPUPriority == PROCESS_CPU_PRIORITY_NORMAL) {
|
||||
return "FOREGROUND_HIGH:CPU_NORMAL";
|
||||
|
@ -84,6 +84,9 @@ enum ProcessPriority {
|
||||
PROCESS_PRIORITY_BACKGROUND_HOMESCREEN,
|
||||
PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE,
|
||||
PROCESS_PRIORITY_FOREGROUND_KEYBOARD,
|
||||
// The special class for the preallocated process, high memory priority but
|
||||
// low CPU priority.
|
||||
PROCESS_PRIORITY_PREALLOC,
|
||||
// Any priority greater than or equal to FOREGROUND is considered
|
||||
// "foreground" for the purposes of priority testing, for example
|
||||
// CurrentProcessIsForeground().
|
||||
|
@ -1258,6 +1258,9 @@ EnsureKernelLowMemKillerParamsSet()
|
||||
nsPrintfCString("hal.processPriorityManager.gonk.%s.KillUnderKB",
|
||||
ProcessPriorityToString(priority)).get(),
|
||||
&killUnderKB))) {
|
||||
// ProcessPriority values like PROCESS_PRIORITY_FOREGROUND_KEYBOARD,
|
||||
// which has only OomScoreAdjust but lacks KillUnderMB value, will not
|
||||
// create new LMK parameters.
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user