[Virtual-pkg-base-maintainers] Bug#825213: Incomplete statistics to manage balloon effectively

Anna Melekhova (Vorobyova) annam at virtuozzo.com
Tue May 24 14:59:33 UTC 2016


Package: base
Version: Debian 7, Debian 8

There is QEMU/KVM and a Linux OS running inside the guest. 
Inside the Linux guest a balloon consumes memory in accordance with 
commands performed on the host side in QEMU and reports some statistics through memstat structure.
For the Linux guest reported “free” value doesn’t describe the guest memory pressure at all.
The provided patch set in Linux kernel extends the stat with available field.

The problem is addressed in mainstream Linux with the following patchset:

commit
5057dcd0f1aaad57e07e728ba20a99e205c6b9de
Author: Igor Redko <redkoi at virtuozzo.com>
Date: Thu Mar 17 15:09:34 2016 -0700
virtio_balloon: export 'available' memory to balloon statistics

Add a new field, VIRTIO_BALLOON_S_AVAIL, to virtio_balloon memory
statistics protocol, corresponding to 'Available' in /proc/meminfo.

It indicates to the hypervisor how big the balloon can be inflated
without pushing the guest system to swap.

Signed-off-by: Igor Redko <redkoi at virtuozzo.com>
Signed-off-by: Denis V. Lunev <den at openvz.org>
Reviewed-by: Roman Kagan <rkagan at virtuozzo.com>
Cc: Michael S. Tsirkin <mst at redhat.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>


commit d02bd27bd33dd7e8d22594cd568b81be0cb584cd
Author: Igor Redko <redkoi at virtuozzo.com>
Date: Thu Mar 17 15:09:34 2016 -0700
mm/page_alloc.c: calculate 'available' memory in a separate function

Add a new field, VIRTIO_BALLOON_S_AVAIL, to virtio_balloon memory
statistics protocol, corresponding to 'Available' in /proc/meminfo.

It indicates to the hypervisor how big the balloon can be inflated
without pushing the guest system to swap.  This metric would be very
useful in VM orchestration software to improve memory management of
different VMs under overcommit.

This patch (of 2):

Factor out calculation of the available memory counter into a separate
exportable function, in order to be able to use it in other parts of the
kernel.

In particular, it appears a relevant metric to report to the hypervisor
via virtio-balloon statistics interface (in a followup patch).

Signed-off-by: Igor Redko <redkoi at virtuozzo.com>
Signed-off-by: Denis V. Lunev <den at openvz.org>
Reviewed-by: Roman Kagan <rkagan at virtuozzo.com>
Cc: Michael S. Tsirkin <mst at redhat.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>



More information about the Virtual-pkg-base-maintainers mailing list