Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f3751611 authored by Vinayak Menon's avatar Vinayak Menon Committed by Prakash Gupta
Browse files

mm: do not fail non-costly allocs if there are reclaimable pages



should_reclaim_retry can fail for order > 0 allocs even if there are
reclaimable pages. The decision to retry is then left to compaction
progress in should_compact_retry. Shrinkers like lowmemorykiller
which does the reclaim based on page cache levels can take time to
free up memory. By this time, compaction can complete scanning
(COMPACT_COMPLETE) without success. This results in an early failure
(compaction_failed) in should_compact_retry, when there are enough
tasks available for lowmemorykiller to kill. This results in premature
OOMs.

It can be argued, how this condition is different from a case
where any reclaimable slab is consuming major part of system's memory.
The difference is that for other reclaimable slabs, a pressure equivalent
to that put on LRU is put on them, resulting in faster reclaim. But that
is the not the case with lowmemorykiller which doesn't even trigger until
certain page cache levels are reached, and there can be cases of tasks not
available in lower oom_score_adj ranges resulting in no kills.

Thus when lowmemorykiller is enabled, retry non-costly allocs till there
are enough reclaimable pages and if we are making progress in reclaim.
For costly orders leave the decision to existing compaction progress logic.

Change-Id: I177cdd11e3f45d7f8fcf02435f7ef5834408fb6f
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 3771b884
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment