crosvm balance available memory
crosvm balance available memory

Poll available memory from the host and guest every second. Resize the
balloon so that available memory in the guest is the same as in the
host.

balancemem_timer adds a Token::BalanceMemory to poll_ctx every second
which creates a balloon stats request.
When the stats results come back from the guest, we compute how much the
balloon should change to balance available memory between the guest and
host. If this new balloon size is > 5% different than the current
balloon size, we make a BalloonControlCommand::Adjust to resize the
balloon.

BUG=b:147334004
TEST=tast run <DUT> arc.MemoryChomeOSPerf*, .vm shows memory use similar
to the base arc test. tast run <DUT> arc.MemoryShiftingPerf.vm, both
chromeos and android counters report high numbers. Switch
LOWMEM_AVAILABLE constant to non-existing file, check the ARCVM reports
not running in ChromeOS, but still boots.

Change-Id: I8a581f86bf4881541d2f5f26dc541b35b862d244
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2061518
Reviewed-by: Lepton Wu <98fe55dd9d3c1cbbf1dc9faf0be9e8ebf7fc5bb6@chromium.org>
Reviewed-by: Charles Dueck <055fff3faf3ee027f98fd9c3410ee5fb441fda44@chromium.org>
Tested-by: kokoro <2ac7b1f3fa578934c95181d4272be0d3bca00121@google.com>
Commit-Queue: Charles Dueck <055fff3faf3ee027f98fd9c3410ee5fb441fda44@chromium.org>

google/crosvm,google/crosvm,google/crosvm,google/crosvm