]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
mm/page_alloc.c: calculate 'available' memory in a separate function
authorIgor Redko <redkoi@virtuozzo.com>
Wed, 8 Jun 2016 16:58:07 +0000 (10:58 -0600)
committerKamal Mostafa <kamal@canonical.com>
Fri, 10 Jun 2016 13:32:25 +0000 (06:32 -0700)
commit95462b66728cc999053ad149a0dbe54d9c7bacc7
treefc59e846de120e13552d27772c8ca7285738128c
parent80bae8d56df4c36622c7f918c62d89bd6421459b
mm/page_alloc.c: calculate 'available' memory in a separate function

BugLink: http://bugs.launchpad.net/bugs/1587091
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@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Roman Kagan <rkagan@virtuozzo.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(back ported from commit d02bd27bd33dd7e8d22594cd568b81be0cb584cd)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Conflicts:
fs/proc/meminfo.c

Acked-by: Chris J Arges <chris.j.arges@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
fs/proc/meminfo.c
include/linux/mm.h
mm/page_alloc.c