From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH][block] qcow2: Support exact L1 table growth
Date: Tue, 19 Oct 2010 12:37:17 +0200 [thread overview]
Message-ID: <4CBD74DD.7060006@redhat.com> (raw)
In-Reply-To: <1287417233-23688-1-git-send-email-stefanha@linux.vnet.ibm.com>
Am 18.10.2010 17:53, schrieb Stefan Hajnoczi:
> The L1 table grow operation includes a size calculation that bumps up
> the new L1 table size in order to anticipate the size needs of vmstate
> data. This helps reduce the number of times that the L1 table has to be
> grown when vmstate data is appended.
>
> This size overhead is not necessary during image creation,
> bdrv_truncate(), or snapshot goto operations. In fact, existing
> qemu-iotests that exercise table growth are no longer able to trigger it
> because image creation preallocates an L1 table that is too large after
> changes to qcow_create2().
>
> This patch keeps the size calculation but also adds exact growth for
> callers that do not want to inflate the L1 table size unnecessarily.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> ---
> block/qcow2-cluster.c | 25 ++++++++++++++++---------
> block/qcow2-snapshot.c | 2 +-
> block/qcow2.c | 2 +-
> block/qcow2.h | 2 +-
> 4 files changed, 19 insertions(+), 12 deletions(-)
>
> Hi Kevin,
> This patch fixes the qcow_create2() issue seen in qemu-iotests 026 with your
> kevin.git/block branch. The issue was that the L1 table size of new images is
> inflated by qcow2_grow_l1_table(). This caused the differences in the test,
> e.g. L1 table grow tests no longer worked because they couldn't force the table
> to grow (it was already more than large enough).
>
> If we use exact L1 growth in bdrv_truncate() then less image space is wasted
> and the test passes again without changes to 026.out.
>
> I think this patch is the way to go, not just to satisfy the test, but also
> because we don't need to overallocate L1 tables to start with.
Good that you took a look at it, I hadn't even thought of changing the
qcow2 code. I agree that this makes sense even independent of qemu-iotests.
The patch looks good to me, too.
Kevin
next prev parent reply other threads:[~2010-10-19 10:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-18 15:53 [Qemu-devel] [PATCH][block] qcow2: Support exact L1 table growth Stefan Hajnoczi
2010-10-19 10:37 ` Kevin Wolf [this message]
2010-10-19 16:15 ` [Qemu-devel] " Kevin Wolf
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=4CBD74DD.7060006@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/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.