virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@parallels.com>
Cc: den@openvz.org, virtualization@lists.linux-foundation.org,
	Raushaniya Maksudova <rmaksudova@parallels.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [PATCH 0/2] shrink virtio baloon on OOM in guest
Date: Wed,  8 Oct 2014 14:21:07 +0400	[thread overview]
Message-ID: <1412763669-2980-1-git-send-email-den@parallels.com> (raw)

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 baloon 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 to
return and retry the allocation that forced the out of memory killer to run.

Patch 1 of this series adds support for implementation of virtio_balloon
callback, so now leak_balloon() function returns number of freed pages.
Patch 2 implements virtio_balloon callback itself.

Signed-off-by: Raushaniya Maksudova <rmaksudova@parallels.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Rusty Russell <rusty@rustcorp.com.au>
CC: Michael S. Tsirkin <mst@redhat.com>
CC: virtualization@lists.linux-foundation.org

             reply	other threads:[~2014-10-08 10:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 10:21 Denis V. Lunev [this message]
2014-10-08 10:21 ` [PATCH 1/2] virtio_balloon: return the amount of freed memory from leak_balloon() Denis V. Lunev
2014-10-08 10:21 ` [PATCH 2/2] virtio_balloon: free some memory from baloon on OOM Denis V. Lunev
2014-10-13  5:32   ` Rusty Russell
2014-10-13  7:01     ` Denis V. Lunev
2014-10-13  7:22     ` Michael S. Tsirkin
2014-10-13 23:44       ` Rusty Russell
2014-10-14  9:10         ` Michael S. Tsirkin
2014-10-15  5:37           ` Rusty Russell
2014-10-15  6:32           ` Denis V. Lunev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412763669-2980-1-git-send-email-den@parallels.com \
    --to=den@parallels.com \
    --cc=den@openvz.org \
    --cc=mst@redhat.com \
    --cc=rmaksudova@parallels.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).