Resend remaining VMAs on partial compaction due to failure

process_madvise syscall returns the total bytes that were processed
however, upon failure it will send the partial amount of bytes
that were processed in which case this patch aims to resend the
remaining vmas upon partial advise. This way we would effectively
process the whole range of vmas rather than skipping the rest of
the vmas in batch when process_madvise does a partial advise.
The approach for managing vmas was changing to be a consumer approach
where bytes are taken off the batch until its reduced to zero
to make it more maintainable and avoid recomputing indices already
visited.

Test: Manual
Test: am compact <pid> <uid> full
Bug: 205658049
Bug: 231443984

Signed-off-by: Edgar Arriaga <edgararriaga@google.com>
Change-Id: I4e5195679d5e9707b9a723e706279124d2cc73b3
1 file changed