This series makes the qcow2 L2 cache cover the entire image by default. The importance of this change is in noticeable performance improvement, especially with heavy random I/O. The memory overhead is very small: only 1 MB of cache for every 8 GB of image size. On systems with very limited RAM the maximal cache size can be limited by the existing cache-size and l2-cache-size options.
The L2 cache is also resized accordingly, by default, if the image is resized. The reasons for making this behavior default, unlike in the patches I have sent previously, are the following: 1) Unelegant complications with making an option to accept either a size or a string, while outputting a proper error message. 2) More bulky logic to sort out what to do if the image is being resized but the (defined) overall cache size is too small to contain the new l2-cache-size. (Making this behavior default resolves all of these technical issues neatly) 3) The performance gain (as measured by fio in random read/write tests) can be as high as 50%, or even more, so this would be a reasonable default behavior. 4) The memory overhead is really small for the gain, and in cases when memory economy is critical, the maximal cache values can always be set by the appropriate options. Leonid Bloch (6): Update .gitignore qcow2: A grammar fix in conflicting cache sizing error message qcow2: Options' documentation fixes qcow2: Update total_sectors when resizing the image qcow2: Make the default L2 cache sufficient to cover the entire image qcow2: Resize the cache upon image resizing .gitignore | 1 + block/qcow2.c | 20 +++++++++++++------- block/qcow2.h | 4 ---- docs/qcow2-cache.txt | 30 +++++++++++++++++------------- qapi/block-core.json | 6 +++--- qemu-options.hx | 15 +++++++++------ tests/qemu-iotests/103.out | 4 ++-- tests/qemu-iotests/137.out | 2 +- 8 files changed, 46 insertions(+), 36 deletions(-) -- 2.17.1