Skip to content
Commit c3b8d65a authored by Edgar Arriaga's avatar Edgar Arriaga Committed by Edgar Arriaga García
Browse files

Cancel compaction if the process improves its OOM ranking while

compaction is running

There is a significant delay between the time we issue a compaction and
when its done during this time the OOM adjust sometimes changes,
however, the current compaction still keeps running, which
leads to situations where proc A starts running while compaction
for proc A is happening leading to long delays as compaction grabs
the mmap_lock thus not allowing for allocations to happen
during that time.

So the aim of this CL is to reduce the likelihood of such situations by
avoiding continuing compaction when we detect such OOM adjust
improvement outside of cache state. Note that we do not kill
the currently running process_madvise, instead we avoid issuing
new process_madvise calls so this will likely improve situations
where an app has many VMAs.

Test: Manual. Checked that JNI callback happens and that
OOM adjusts match as well as checked that compaction is cancelled
when the improvement in OOM happens.

Bug: 208966958
Change-Id: I202a96d884e2a0dc7ac7013eca91a36cd58acc80
Merged-In: I202a96d884e2a0dc7ac7013eca91a36cd58acc80
(cherry picked from commit 29a3a5b1)
parent dd7601c9
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