]> git.proxmox.com Git - mirror_qemu.git/commit - Makefile.objs
qcow2: Add QcowCache
authorKevin Wolf <kwolf@redhat.com>
Mon, 10 Jan 2011 16:15:10 +0000 (17:15 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 24 Jan 2011 10:08:51 +0000 (11:08 +0100)
commit493810940bfaad0fd5dd9bfb79cdc89519f89588
tree4411cb848b5180d8792cc31ae5d01680997c0597
parentc641483fbe0aa08cd7c0580d019dc2d5a7e71138
qcow2: Add QcowCache

This adds some new cache functions to qcow2 which can be used for caching
refcount blocks and L2 tables. When used with cache=writethrough they work
like the old caching code which is spread all over qcow2, so for this case we
have merely a cleanup.

The interesting case is with writeback caching (this includes cache=none) where
data isn't written to disk immediately but only kept in cache initially. This
leads to some form of metadata write batching which avoids the current "write
to refcount block, flush, write to L2 table" pattern for each single request
when a lot of cluster allocations happen. Instead, cache entries are only
written out if its required to maintain the right order. In the pure cluster
allocation case this means that all metadata updates for requests are done in
memory initially and on sync, first the refcount blocks are written to disk,
then fsync, then L2 tables.

This improves performance of scenarios with lots of cluster allocations
noticably (e.g. installation or after taking a snapshot).

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Makefile.objs
block/qcow2-cache.c [new file with mode: 0644]
block/qcow2.h