qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation


From: Kevin Wolf
Subject: Re: [Qemu-block] [RFC] Proposed qcow2 extension: subcluster allocation
Date: Thu, 13 Apr 2017 11:02:10 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 13.04.2017 um 10:05 hat Alberto Garcia geschrieben:
> On Wed 12 Apr 2017 04:10:46 PM CEST, Max Reitz <address@hidden> wrote:
> >> I still don't see why we can always assume OFLAG_COPIED. Before doing
> >> the COW one cluster can have references from multiple snapshots,
> >
> > Yes...
> >
> >> and OFLAG_COPIED is equally valid in that context.
> >
> > In what context? When having subclusters? Why?
> >
> >> We still need to know if we need to perform COW when writing to it,
> >> regardless of whether it has subclusters or not.
> >
> > But why would you reference a cluster multiple times if it has
> > subclusters? Yes, you can do it in theory, but we could just disallow
> > it, because it doesn't make sense.
> 
> We discussed this yesterday on IRC, but I'm writing the summary here for
> reference:
> 
> if you want be able to create internal snapshots quickly without having
> to copy a lot of data, you need to be able to have multiple references
> to one cluster.
> 
> Anyway, it seems that this discussion is only relevant if we're trying
> to save as many bits as possible because we want to store everything in
> a 64-bit entry -alternative (1) from my original e-mail-. I agree that
> for that alternative the usefulness of that bit can be put into
> question.

I think you still need it if you don't want to look at the refcount
blocks for every write. When you take an internal snapshot, you just
increase the refcount of the L2 tables at first and keep the contents
the same, including the subcluster information. On the first write to
the cluster, like with normal images you need to copy the whole cluster,
and whether this is the case is determined with the COPIED flag. (The
copy can actually keep unallocated/zeroed subclusters that way, but data
has to be copied for the whole cluster.)

Of course, in all cases the COPIED flag is just an optimisation because
it's always possible to look at the refcount blocks, but I don't think
there is any difference between subclustered and traditional images in
this respect.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]