Commit 9709c6f5 authored by Charles William Dick's avatar Charles William Dick Committed by Commit Bot

tab manager defer to Android LMK in VM

It is not possible to directly reclaim memory from ARCVM based Android
apps, so don't kill them.

In ARCVM, the virtio balloon is sized to balance available memory
between host and guest, so if there is critical memory pressure in
Chrome, there will also be limited memory in the Android guest. ARCVM
relies on the Android Low Memory Killer running in the guest to kill
apps, increasing the memory available to the guest, which will be
returned to the host with the virtio balloon.

BUG=b:147336074
TEST=launch ARCVM, run 'grep 'WARNING debugd' /var/log/messages'.
verify there's no warning from debugd.
tast run <DUT> arc.MemoryChromeOSPerf.vm, also see no warnings in
/var/log/messages. (this will force critical memory pressure)

Change-Id: I7d610ea44eaf45494f6b4143b053779f6f3df6d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135094Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Charles Dueck <cwd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756962}
parent 3b59012f
......@@ -347,7 +347,9 @@ void TabManagerDelegate::LowMemoryKill(
TabManager::TabDiscardDoneCB tab_discard_done) {
arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get();
base::TimeTicks now = base::TimeTicks::Now();
if (arc_process_service) {
// ARCVM defers to Android's LMK to kill apps in low memory situations because
// memory can't be reclaimed directly to ChromeOS.
if (arc_process_service && !arc::IsArcVmEnabled()) {
arc_process_service->RequestAppProcessList(base::BindOnce(
&TabManagerDelegate::LowMemoryKillImpl, weak_ptr_factory_.GetWeakPtr(),
now, reason, std::move(tab_discard_done)));
......@@ -487,7 +489,8 @@ void TabManagerDelegate::AdjustOomPriorities() {
return;
arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get();
// TODO(b/135633925): Design and implement OOM handling for ARCVM.
// ARCVM defers to Android's LMK to manage low memory situations, so don't
// adjust OOM scores for VM processes.
if (arc_process_service && !arc::IsArcVmEnabled()) {
arc_process_service->RequestAppProcessList(
base::BindOnce(&TabManagerDelegate::AdjustOomPrioritiesImpl,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment