qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH v2 6/7] qed: Read/write support


From: Avi Kivity
Subject: Re: [Qemu-devel] Re: [PATCH v2 6/7] qed: Read/write support
Date: Wed, 13 Oct 2010 16:10:25 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100921 Fedora/3.1.4-1.fc13 Thunderbird/3.1.4

 On 10/13/2010 04:07 PM, Stefan Hajnoczi wrote:
On Wed, Oct 13, 2010 at 03:50:00PM +0200, Avi Kivity wrote:
>   On 10/13/2010 03:24 PM, Anthony Liguori wrote:
>  >On 10/13/2010 08:07 AM, Kevin Wolf wrote:
>  >>Am 13.10.2010 14:13, schrieb Stefan Hajnoczi:
>  >>>We can avoid it when a backing image is not used.  Your idea to check
>  >>>for zeroes in the backing image is neat too, it may well reduce the
>  >>>common case even for backing images.
>  >>The additional requirement is that we're extending the file and not
>  >>reusing an old cluster. (And bdrv_has_zero_init() == true, but QED
>  >>doesn't work on host_devices anyway)
>  >
>  >Yes, that's a good point.
>  >
>  >BTW, I think we've decided that making it work on host_devices is
>  >not that bad.
>  >
>  >We can add an additional feature called QED_F_PHYSICAL_SIZE.
>  >
>  >This feature will add another field to the header that contains an
>  >offset immediately following the last cluster allocation.
>  >
>  >During a metadata scan, we can accurately recreate this field so
>  >we only need to update this field whenever we clear the header
>  >dirty bit (which means during an fsync()).
>
>  If you make QED_F_PHYSICAL_SIZE an autoclear bit, you don't need the
>  header dirty bit.

Do you mean we just need to check the physical size header field against
the actual file size?  If the two are different, then a consistency
check is forced.

I thought you'd only use a header size field when you don't have a real file size. Why do you need both?

>  >
>  >That means we can maintain the physical size without introducing
>  >additional fsync()s in the allocation path.  Since we're already
>  >writing out the header anyway, the write operation is basically
>  >free too.
>
>  I don't see how it is free.  It's an extra write.  The good news is
>  that it's very easy to amortize.

We only need to update the header field on disk when we're already
updating the header, so it's not even an extra write operation.

Why would you ever update the header, apart from relocating L1 for some reason?

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.




reply via email to

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