1. 21 1月, 2015 1 次提交
  2. 11 11月, 2014 1 次提交
    • R
      virtio_balloon: free some memory from balloon on OOM · 5a10b7db
      Raushaniya Maksudova 提交于
      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 some memory at the last moment before some process will be 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 to return and retry the allocation that forced the out of
      memory killer to run.
      
      Allocate virtio  feature bit for this: it is not set by default,
      the the guest will not deflate virtio balloon on OOM without explicit
      permission from host.
      Signed-off-by: NRaushaniya Maksudova <rmaksudova@parallels.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      5a10b7db
  3. 02 4月, 2013 1 次提交
  4. 13 10月, 2012 1 次提交
  5. 30 5月, 2011 1 次提交
  6. 24 2月, 2010 1 次提交
    • A
      virtio: Add memory statistics reporting to the balloon driver (V4) · 9564e138
      Adam Litke 提交于
      Changes since V3:
       - Do not do endian conversions as they will be done in the host
       - Report stats that reference a quantity of memory in bytes
       - Minor coding style updates
      
      Changes since V2:
       - Increase stat field size to 64 bits
       - Report all sizes in kb (not pages)
       - Drop anon_pages stat and fix endianness conversion
      
      Changes since V1:
       - Use a virtqueue instead of the device config space
      
      When using ballooning to manage overcommitted memory on a host, a system for
      guests to communicate their memory usage to the host can provide information
      that will minimize the impact of ballooning on the guests.  The current method
      employs a daemon running in each guest that communicates memory statistics to a
      host daemon at a specified time interval.  The host daemon aggregates this
      information and inflates and/or deflates balloons according to the level of
      host memory pressure.  This approach is effective but overly complex since a
      daemon must be installed inside each guest and coordinated to communicate with
      the host.  A simpler approach is to collect memory statistics in the virtio
      balloon driver and communicate them directly to the hypervisor.
      
      This patch enables the guest-side support by adding stats collection and
      reporting to the virtio balloon driver.
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      Cc: Anthony Liguori <anthony@codemonkey.ws>
      Cc: virtualization@lists.linux-foundation.org
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (minor fixes)
      9564e138
  7. 22 10月, 2009 1 次提交
    • C
      virtio: let header files include virtio_ids.h · e95646c3
      Christian Borntraeger 提交于
      Rusty,
      
      commit 3ca4f5ca
          virtio: add virtio IDs file
      moved all device IDs into a single file. While the change itself is
      a very good one, it can break userspace applications. For example
      if a userspace tool wanted to get the ID of virtio_net it used to
      include virtio_net.h. This does no longer work, since virtio_net.h
      does not include virtio_ids.h.
      This patch moves all "#include <linux/virtio_ids.h>" from the C
      files into the header files, making the header files compatible with
      the old ones.
      
      In addition, this patch exports virtio_ids.h to userspace.
      
      CC: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      e95646c3
  8. 23 9月, 2009 1 次提交
  9. 30 12月, 2008 1 次提交
  10. 25 7月, 2008 1 次提交
  11. 04 2月, 2008 1 次提交
    • R
      virtio: balloon driver · 6b35e407
      Rusty Russell 提交于
      After discussions with Anthony Liguori, it seems that the virtio
      balloon can be made even simpler.  Here's my attempt.
      
      The device configuration tells the driver how much memory it should
      take from the guest (ie. balloon size).  The guest feeds the page
      numbers it has taken via one virtqueue.
      
      A second virtqueue feeds the page numbers the driver wants back: if
      the device has the VIRTIO_BALLOON_F_MUST_TELL_HOST bit, then this
      queue is compulsory, otherwise it's advisory (and the guest can simply
      fault the pages back in).
      
      This driver can be enhanced later to deflate the balloon via a
      shrinker, oom callback or we could even go for a complete set of
      in-guest regulators.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      6b35e407