On 07/14/2011 08:24 AM, Eric Blake wrote:
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'.
P.S. O_DIRECT is a pain. I wish that
posix_fallocate(,POSIX_FADV_SEQUENTIAL) and
posix_fallocate(,POSIX_FADV_NOREUSE) were stateful - then libvirt could
just declare that the fd is intended to be used in order without leaving
behind any caching, then pass the fd on to qemu or the compression
program, and the kernel would remember the previous hints and
automatically handle the issue without having to go through the
libvirt_iohelper program. But the Linux kernel isn't there yet.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org