]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2.c
qcow2: Assign the L2 cache relatively to the image size
authorLeonid Bloch <lbloch@janustech.com>
Wed, 26 Sep 2018 16:04:43 +0000 (19:04 +0300)
committerKevin Wolf <kwolf@redhat.com>
Mon, 1 Oct 2018 10:51:12 +0000 (12:51 +0200)
commitb749562d9822d14ef69c9eaa5f85903010b86c30
treec1b104511519217d7134b190eb0f89ee498c6eab
parent657ada52abb85140e56949f522ecec527b256450
qcow2: Assign the L2 cache relatively to the image size

Sufficient L2 cache can noticeably improve the performance when using
large images with frequent I/O.

Previously, unless 'cache-size' was specified and was large enough, the
L2 cache was set to a certain size without taking the virtual image size
into account.

Now, the L2 cache assignment is aware of the virtual size of the image,
and will cover the entire image, unless the cache size needed for that is
larger than a certain maximum. This maximum is set to 1 MB by default
(enough to cover an 8 GB image with the default cluster size) but can
be increased or decreased using the 'l2-cache-size' option. This option
was previously documented as the *maximum* L2 cache size, and this patch
makes it behave as such, instead of as a constant size. Also, the
existing option 'cache-size' can limit the sum of both L2 and refcount
caches, as previously.

Signed-off-by: Leonid Bloch <lbloch@janustech.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c
block/qcow2.h
docs/qcow2-cache.txt
qemu-options.hx
tests/qemu-iotests/137
tests/qemu-iotests/137.out