Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
mm: Always indicate OOM kill progress when Simple LMK is enabled
Browse files Browse the repository at this point in the history
When Simple LMK is enabled, the page allocator slowpath always thinks that
no OOM kill progress is made because out_of_memory() returns false. As a
result, spurious page allocation failures are observed when memory is low
and Simple LMK is killing tasks, simply because the page allocator slowpath
doesn't think that any OOM killing is taking place.

Fix this by simply making out_of_memory() always return true when Simple
LMK is enabled.

Signed-off-by: Sultan Alsawaf <[email protected]>
  • Loading branch information
kerneltoast authored and reocat committed Jan 14, 2024
1 parent c3a3fd1 commit 4ad6625
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,11 @@ bool out_of_memory(struct oom_control *oc)
unsigned int uninitialized_var(points);
enum oom_constraint constraint = CONSTRAINT_NONE;

if (oom_killer_disabled || IS_ENABLED(CONFIG_ANDROID_SIMPLE_LMK))
/* Return true since Simple LMK automatically kills in the background */
if (IS_ENABLED(CONFIG_ANDROID_SIMPLE_LMK))
return true;

if (oom_killer_disabled)
return false;

blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
Expand Down

0 comments on commit 4ad6625

Please sign in to comment.