mm: Always indicate OOM kill progress when Simple LMK is enabled

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 <sultan@kerneltoast.com>
fourteen
Sultan Alsawaf 1 year ago committed by Jenna
parent 26ea3c9934
commit 7d96f7bacb
  1. 6
      mm/oom_kill.c

@ -1052,7 +1052,11 @@ bool out_of_memory(struct oom_control *oc)
unsigned long freed = 0;
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;
if (try_online_one_block(numa_node_id())) {

Loading…
Cancel
Save