From: Kevin Wolf <kwolf@redhat.com>
To: Dietmar Maurer <dietmar@proxmox.com>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] qcow2: slow internal snapshot creation
Date: Fri, 23 Nov 2012 16:31:19 +0100 [thread overview]
Message-ID: <50AF96C7.3030506@redhat.com> (raw)
In-Reply-To: <24E144B8C0207547AD09C467A8259F755782F76D@lisa.maurer-it.com>
Am 23.11.2012 08:26, schrieb Dietmar Maurer:
> qcow2 snapshot on newly created files are fast:
>
> # qemu-img create -f qcow2 test.img 200G
> # time qemu-img snapshot -c snap1 test.img
> real 0m0.014s
>
> but if metadata is allocated it gets very slow:
>
> # qemu-img create -f qcow2 -o "preallocation=metadata" test.img 200G
> # time qemu-img snapshot -c snap1 test.img
> real 1m20.399s
>
> but reading the metadata is also fast:
>
> # time qemu-img check test.img
> real 0m0.371s
>
> So why is creating a new snapshot that slow – any ideas?
Had a look at this now. The culprit is the unconditional bdrv_flush() in
update_cluster_refcount(). I suspect it's completely unnecessary by now,
but I need to give it a closer review before I send a patch to remove
it. (And in any case error handling is missing there)
Affected are writing compressed images and creating/deleting internal
snapshots, no other code uses this path.
Kevin
prev parent reply other threads:[~2012-11-23 15:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-23 7:26 [Qemu-devel] qcow2: slow internal snapshot creation Dietmar Maurer
2012-11-23 14:03 ` Alexandre DERUMIER
2012-11-23 14:09 ` Kevin Wolf
2012-11-23 14:17 ` Alexandre DERUMIER
2012-11-23 14:58 ` Kevin Wolf
2012-11-23 15:53 ` Alexandre DERUMIER
2012-11-23 15:31 ` Kevin Wolf [this message]
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=50AF96C7.3030506@redhat.com \
--to=kwolf@redhat.com \
--cc=dietmar@proxmox.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).