[libvirt] [PATCH 0/8] Avoid filesystem cache pollution during virsh save

Eric Blake eblake at redhat.com
Thu Jul 14 14:24:27 UTC 2011


Saving a domain's state creates a large file, which risks polluting
the filesystem cache and slowing down a system.  If a system has
a lot of domians simultaneously being saved (such as the libvirt-guests
init script doing managed saves), then this can cause noticeable slowdown
due to filesystem thrashing.

This patch series has been successfully tested to do 'virsh save
dom file --direct', with lsof(1) used to verify that O_DIRECT was
in use, and the resulting file was successfully used with 'virsh
restore file'.

Still to come - wire up O_DIRECT on the 'virsh restore' path (yes,
that means adding virDomainRestoreFlags - if only we had had the
foresight to use flags everywhere).  Wire up qemu.conf to allow
the automatic use of --direct on automatic core dumps.  Wire up
libvirt-guests init script to allow the use of --direct.

But I had enough in place to get the review started now.

Also, this series demonstrates some of the points I was
making about adding a new Flags API in this thread:
https://www.redhat.com/archives/libvir-list/2011-July/msg00762.html

This series requires and was tested on top of these (un-acked) patches:
https://www.redhat.com/archives/libvir-list/2011-July/msg00670.html
https://www.redhat.com/archives/libvir-list/2011-July/msg00675.html

Eric Blake (8):
  save: document new public API
  save: wire up remote protocol
  save: wire up trivial saveFlags implementations
  save: add --direct flag to virsh save operations
  save: let iohelper handle inherited fd
  save: let iohelper work on O_DIRECT fds
  save: add virDirectFd wrapper type
  save: support O_DIRECT during qemu saves

 cfg.mk                       |    1 +
 configure.ac                 |    6 +-
 include/libvirt/libvirt.h.in |   14 +++
 po/POTFILES.in               |    1 +
 src/Makefile.am              |    1 +
 src/driver.h                 |    6 ++
 src/fdstream.c               |   32 +++-----
 src/libvirt.c                |   94 +++++++++++++++++++++-
 src/libvirt_private.syms     |    6 ++
 src/libvirt_public.syms      |    5 +
 src/libxl/libxl_driver.c     |   17 ++++-
 src/qemu/qemu_driver.c       |   76 +++++++++++++-----
 src/remote/remote_driver.c   |    1 +
 src/remote/remote_protocol.x |   11 +++-
 src/remote_protocol-structs  |    6 ++
 src/test/test_driver.c       |   20 ++++-
 src/util/iohelper.c          |  185 +++++++++++++++++++++++++++++++----------
 src/util/virdirect.c         |  149 +++++++++++++++++++++++++++++++++
 src/util/virdirect.h         |   37 +++++++++
 src/vbox/vbox_tmpl.c         |   19 ++++-
 src/xen/xen_driver.c         |   17 ++++-
 tools/virsh.c                |   12 +++-
 tools/virsh.pod              |   17 +++-
 23 files changed, 632 insertions(+), 101 deletions(-)
 create mode 100644 src/util/virdirect.c
 create mode 100644 src/util/virdirect.h

-- 
1.7.4.4




More information about the libvir-list mailing list