From: Eric Blake <eblake@redhat.com>
To: Leonid Bloch <lbloch@janustech.com>, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>,
Alberto Garcia <berto@igalia.com>
Subject: Re: [Qemu-devel] [PATCH 1/4] qcow2: Introduce an option for sufficient L2 cache for the entire image
Date: Tue, 24 Jul 2018 09:52:17 -0500 [thread overview]
Message-ID: <8966138a-1663-fdcf-e49e-df7e9c802c3e@redhat.com> (raw)
In-Reply-To: <20180724121753.5753-2-lbloch@janustech.com>
On 07/24/2018 07:17 AM, Leonid Bloch wrote:
> An option "l2-cache-full" is introduced to automatically set the qcow2
> L2 cache to a sufficient value for covering the entire image. The memory
> overhead when using this option is not big (1 MB for each 8 GB of
> virtual image size with the default cluster size) and it can noticeably
> improve performance when using large images with frequent I/O.
> Previously, for this functionality the correct L2 cache size needed to
> be calculated manually or with a script, and then this size needed to be
> passed to the "l2-cache-size" option. Now it is sufficient to just pass
> the boolean "l2-cache-full" option.
>
> Signed-off-by: Leonid Bloch <lbloch@janustech.com>
> ---
> @@ -793,15 +800,32 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts,
> *l2_cache_entry_size = qemu_opt_get_size(
> opts, QCOW2_OPT_L2_CACHE_ENTRY_SIZE, s->cluster_size);
>
> + uint64_t virtual_disk_size = bs->total_sectors * BDRV_SECTOR_SIZE;
> + uint64_t max_l2_cache = virtual_disk_size / (s->cluster_size / 8);
> +
> + if (l2_cache_size_set && l2_cache_full_set) {
> + error_setg(errp, QCOW2_OPT_L2_CACHE_SIZE " and "
> + QCOW2_OPT_L2_CACHE_FULL " may not be set at the same time");
> + return;
> + } else if (l2_cache_full_set) {
> + *l2_cache_size = max_l2_cache;
> + }
Since this makes the options mutually exclusive...
> +++ b/qapi/block-core.json
> @@ -2814,6 +2814,9 @@
> # @l2-cache-size: the maximum size of the L2 table cache in
> # bytes (since 2.2)
> #
> +# @l2-cache-full: make the L2 table cache large enough to cover the
> +# entire image (since 3.1)
> +#
...you should probably document that fact here.
> +++ b/qemu-options.hx
> @@ -758,6 +758,10 @@ The maximum total size of the L2 table and refcount block caches in bytes
> The maximum size of the L2 table cache in bytes
> (default: 4/5 of the total cache size)
>
> +@item l2-cache-full
> +Make the L2 table cache large enough to cover the entire image
> +(on/off; default: off)
Likewise.
> +
> @item refcount-cache-size
> The maximum size of the refcount block cache in bytes
> (default: 1/5 of the total cache size)
Alberto, looks like we missed this documentation in your changes to the
defaults.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2018-07-24 14:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 12:17 [Qemu-devel] [PATCH 0/4] Introduction of l2-cache-full option for qcow2 images Leonid Bloch
2018-07-24 12:17 ` [Qemu-devel] [PATCH 1/4] qcow2: Introduce an option for sufficient L2 cache for the entire image Leonid Bloch
2018-07-24 14:52 ` Eric Blake [this message]
2018-08-03 9:27 ` Alberto Garcia
2018-07-24 12:17 ` [Qemu-devel] [PATCH 2/4] docs: Fix an inaccuracy due to recent changes Leonid Bloch
2018-07-24 15:20 ` Eric Blake
2018-07-24 16:25 ` Leonid Bloch
2018-07-24 15:22 ` [Qemu-devel] [PATCH 2/4 for-3.0] " Eric Blake
2018-07-24 12:17 ` [Qemu-devel] [PATCH 3/4] docs: Document the l2-cache-full option Leonid Bloch
2018-07-24 15:21 ` Eric Blake
2018-07-24 16:28 ` Leonid Bloch
2018-07-24 12:17 ` [Qemu-devel] [PATCH 4/4] iotests: Add tests for the new " Leonid Bloch
2018-07-24 15:24 ` Eric Blake
2018-07-24 14:49 ` [Qemu-devel] [PATCH 0/4] Introduction of l2-cache-full option for qcow2 images Eric Blake
2018-07-24 15:19 ` Leonid Bloch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8966138a-1663-fdcf-e49e-df7e9c802c3e@redhat.com \
--to=eblake@redhat.com \
--cc=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=lbloch@janustech.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.