qemu-e2k/include
Denis V. Lunev e3816255bf balloon: add a feature bit to let Guest OS deflate balloon on oom
Excessive virtio_balloon inflation can cause invocation of OOM-killer,
when Linux is under severe memory pressure. Various mechanisms are
responsible for correct virtio_balloon memory management. Nevertheless it
is often the case that these control tools does not have enough time to
react on fast changing memory load. As a result OS runs out of memory and
invokes OOM-killer. The balancing of memory by use of the virtio balloon
should not cause the termination of processes while there are pages in the
balloon. Now there is no way for virtio balloon driver to free memory at
the last moment before some process get killed by OOM-killer.

This does not provide a security breach as balloon itself is running
inside Guest OS and is working in the cooperation with the host. Thus
some improvements from Guest side should be considered as normal.

To solve the problem, introduce a virtio_balloon callback which is
expected to be called from the oom notifier call chain in out_of_memory()
function. If virtio balloon could release some memory, it will make the
system return and retry the allocation that forced the out of memory
killer to run.

This behavior should be enabled if and only if appropriate feature bit
is set on the device. It is off by default.

This functionality was recently merged into vanilla Linux.

  commit 5a10b7dbf904bfe01bb9fcc6298f7df09eed77d5
  Author: Raushaniya Maksudova <rmaksudova@parallels.com>
  Date:   Mon Nov 10 09:36:29 2014 +1030

This patch adds respective control bits into QEMU. It introduces
deflate-on-oom option for balloon device which does the trick.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Raushaniya Maksudova <rmaksudova@parallels.com>
CC: Anthony Liguori <aliguori@amazon.com>
CC: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Acked-by: James Bottomley <JBottomley@Odin.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
2015-06-23 17:08:21 +02:00
..
block Block layer core and image format patches 2015-06-15 10:43:06 +01:00
disas
exec semihosting: add --semihosting-config arg sub-argument 2015-06-19 14:17:45 +01:00
fpu softfloat: expand out STATUS macro 2015-02-06 16:11:38 +00:00
hw balloon: add a feature bit to let Guest OS deflate balloon on oom 2015-06-23 17:08:21 +02:00
libdecnumber
migration Add a protective section footer 2015-06-12 06:54:01 +02:00
monitor audio: remove LOG_TO_MONITOR along with default_mon 2015-06-15 12:42:48 +02:00
net vhost: enable vhost without without MSI-X 2015-06-19 12:17:49 +02:00
qapi qom: Make enum string tables const-correct 2015-06-19 18:42:18 +02:00
qemu QOM infrastructure fixes and device conversions 2015-06-22 12:50:30 +01:00
qom qom: Don't pass string table to object_get_enum() function 2015-06-19 18:42:48 +02:00
standard-headers virtio: update headers, add virtio-gpu (2d) 2015-06-10 11:02:00 +02:00
sysemu semihosting: create SemihostingConfig structure and semihost.h 2015-06-19 14:17:45 +01:00
ui QemuOpts: Convert qemu_opts_foreach() to Error 2015-06-09 07:37:37 +02:00
config.h
elf.h linux/elf.h update 2015-05-27 17:52:03 +02:00
glib-compat.h glib: remove stale compat functions 2015-05-22 15:58:06 -04:00
qemu-common.h machine: add default_ram_size to machine class 2015-06-03 23:56:55 +02:00
qemu-io.h qemu-io: Use BlockBackend 2015-02-16 15:07:19 +00:00
qjson.h QJSON: Add JSON writer 2015-02-05 17:16:14 +01:00
trace-tcg.h
trace.h