PM / sleep: Skip OOM killer toggles when kernel is compiled for Android
Android devices use LMK algorythms, so there's no reason to disable and enable the OOM killer when entering and exiting suspend. This is a fixed version of https://github.com/YaroST12/VIOLENT_kernel/commit/86e59a93b2ef Co-authored-by: Danny Lin <danny@kdrag0n.dev> Signed-off-by: Yaroslav Furman <yaro330@gmail.com> Signed-off-by: celtare21 <celtare21@gmail.com> Signed-off-by: Ren <89468157+Shirayuki39@users.noreply.github.com>
This commit is contained in:
parent
419052d8e5
commit
ec544c143c
1 changed files with 4 additions and 0 deletions
|
@ -165,6 +165,7 @@ int freeze_processes(void)
|
|||
pr_cont("\n");
|
||||
BUG_ON(in_atomic());
|
||||
|
||||
#ifndef CONFIG_ANDROID
|
||||
/*
|
||||
* Now that the whole userspace is frozen we need to disable
|
||||
* the OOM killer to disallow any further interference with
|
||||
|
@ -173,6 +174,7 @@ int freeze_processes(void)
|
|||
*/
|
||||
if (!error && !oom_killer_disable(msecs_to_jiffies(freeze_timeout_msecs)))
|
||||
error = -EBUSY;
|
||||
#endif
|
||||
|
||||
if (error)
|
||||
thaw_processes();
|
||||
|
@ -217,7 +219,9 @@ void thaw_processes(void)
|
|||
pm_freezing = false;
|
||||
pm_nosig_freezing = false;
|
||||
|
||||
#ifndef CONFIG_ANDROID
|
||||
oom_killer_enable();
|
||||
#endif
|
||||
|
||||
pr_info("Restarting tasks ... ");
|
||||
|
||||
|
|
Loading…
Reference in a new issue