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>
This commit is contained in:
Sultan Alsawaf
2023-09-26 19:39:33 -07:00
committed by theshaenix
parent 5cab26b403
commit 4826636dc6

View File

@@ -1018,7 +1018,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())) {