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
3 files changed