Skip to content

Commit

Permalink
PM: sleep: Skip OOM killer toggles when kernel is compiled for Android.
Browse files Browse the repository at this point in the history
 * 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 YaroST12/VIOLENT_Kernel@86e59a93b2ef

Co-authored-by: Danny Lin <[email protected]>
Change-Id: Icb2a57e51128a9ae8d578e697f041ff19871351b
  • Loading branch information
2 people authored and bachnxuan committed Feb 28, 2025
1 parent 5462ba8 commit 7bde282
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,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
Expand All @@ -163,6 +164,7 @@ int freeze_processes(void)
*/
if (!error && !oom_killer_disable(msecs_to_jiffies(freeze_timeout_msecs)))
error = -EBUSY;
#endif

if (error)
thaw_processes();
Expand Down Expand Up @@ -207,7 +209,9 @@ void thaw_processes(void)
pm_freezing = false;
pm_nosig_freezing = false;

#ifndef CONFIG_ANDROID
oom_killer_enable();
#endif

pr_info("Restarting tasks ... ");

Expand Down

0 comments on commit 7bde282

Please sign in to comment.